Comments (5)
In the "dev/version_22" branch different type of objects (dynamic and static objects) can be passed to flightmare_unity (see flightmare/flightlib/src/envs/vision_env/vision_env.cpp, line 67-82) and that's not yet implemented on the flightmare_unity "master" branch.
So I propose to use flightmare_unity "dev/agile_flight" branch instead. Now if you don't have any static objects in a .csv file, you'll still get an error. I therefore adapted the following lines to catch that case (not sure if that's a good fix but it worked for me):
In flightmare_unity/Asset/Flightmare/Script/CameraController.cs replace the following (line 706 - 722)
void instantiateObjects()
{
config_object.ReadCSVFile(internal_state, settings.object_csv, ListToVector3(settings.render_offset));
//
// Initialize additional objects
foreach (var obj_state in settings.static_objects)
{
GameObject prefab = Resources.Load(obj_state.prefabID) as GameObject;
// Debug.Log("obj_state id : " + obj_state.ID);
// GameObject obj = internal_state.getGameobject(obj_state.ID, gate_template);
GameObject obj = internal_state.getGameobject(obj_state.ID, prefab);
obj.transform.localScale = ListToVector3(obj_state.size);
Vector3 obj_position = ListToVector3(obj_state.position) + ListToVector3(settings.render_offset);
obj.transform.SetPositionAndRotation(obj_position, ListToQuaternion(obj_state.rotation));
obj.transform.localScale = ListToVector3(obj_state.size);
// obj.layer = 9;
}
with
void instantiateObjects()
{
try
{
config_object.ReadCSVFile(internal_state, settings.object_csv, ListToVector3(settings.render_offset));
//
// Initialize additional objects
foreach (var obj_state in settings.static_objects)
{
GameObject prefab = Resources.Load(obj_state.prefabID) as GameObject;
// Debug.Log("obj_state id : " + obj_state.ID);
// GameObject obj = internal_state.getGameobject(obj_state.ID, gate_template);
GameObject obj = internal_state.getGameobject(obj_state.ID, prefab);
obj.transform.localScale = ListToVector3(obj_state.size);
Vector3 obj_position = ListToVector3(obj_state.position) + ListToVector3(settings.render_offset);
obj.transform.SetPositionAndRotation(obj_position, ListToQuaternion(obj_state.rotation));
obj.transform.localScale = ListToVector3(obj_state.size);
// obj.layer = 9;
}
}
catch (Exception)
{
print("No static objects found");
}
}
from flightmare.
Hi
Which directory did you put the "flightmare_unity" repo?
from flightmare.
I don't think it matters where you put the flightmare_unity folder. You just need to click play when you run flightmare.
from flightmare.
I am also in the dev/version_22 branch to run the RL example.
I have trained the RL model, and wanted to visualise it user --render 1.
Flightmare has this in their documentation:
"
To use unity rendering, you need first download the binary from Releases and extract it into the flightrender folder. To enable unity for visualization, double click the extracted executable file RPG_Flightmare.x84-64 and then test a pre-trained controller
"
I double click the RPG_Flightmare.x84-64 in the directory: flightmare/flightrender/RPG_Flightmare/RPG_Flightmare.x84-64. I get this:
After that, i go to flightpy/flightrl and run python3 run_control_demo.py --train 0 --render 1
It just says unity connection timed out.
Could you please tell me what might be wrong here? You pointed out that it is something to do with flightmare_unity, but where are we even using it?
Thank you
from flightmare.
Hey, I cloned flightmare_unity, built everything from scratch from https://github.com/uzh-rpg/flightmare/blob/master/docs/source/building_flightmare_binary/standalone.rst
And then followed steps as outlined by you. I can see the drone on unity now.
Thanks!
from flightmare.
Related Issues (20)
- Fixed-wing UAV simulation
- Ubuntu 22.04 creating cameras
- RPG_Flightmare.x84-64 freeze with forest environment HOT 2
- Issue with installing through pip install . on fresh install of Ubuntu 20.04: subprocess.CalledProcessError
- Error when build catkin during lanelet2 installation?
- issue with installing flightlib with pip HOT 7
- Error when compiling flightlib on MacOS
- Not able to connect to Unity when training policy
- Missing requirements file HOT 1
- catkin bulid Error HOT 2
- Question on IMU integration and using RotorS
- protobuf requires Python '>=3.7' but the running Python is 3.6.9 HOT 1
- Depth image problem in the forest environment using a unity standalone build
- gzserver: symbol lookup error on running rotors_gazebo.launch
- Segmentation fault(core dumped) when I try to instantiate RGBCamera with the compiled libflightlib.a
- Bodyrates and cumulative thrust as input for vec_env.step
- Can this simulator be used for flexible cables attached with drones ?
- Parallel Camera Rendering
- fatal error: polynomial_trajectories/minimum_snap_trajectories.h: No such file or directory
- Initialization Error of Unity Rendering in RL Applications
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flightmare.