-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gazebo in tudelft conf, with orange avoid example #2149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rebase this on the current master to solve the conflicts?
There are some differences in how you tab the .world files, I would recommend you pick one and stick to it.
@@ -0,0 +1,213 @@ | |||
<!DOCTYPE airframe SYSTEM "../airframe.dtd"> | |||
|
|||
<airframe name="ardrone2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the only difference here that gazebo loads the cyberzoo instead of the empty environment? Then I don't think you should add an extra example for this. One example specifically for gazebo is enough.
If you want to add an ardrone that can avoid orange poles that happens to also work in simulation then you can add this as ardrone2_pole_avoider or something like that. I still don't think that this should be in the examples but in the tudelft given that it is a bit specific to the cyberzoo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will partially be solved with: #2172
But for now we still need a separate airframe file in order to have the orange_avoid module. One solution to this was: https://github.com/dewagter/paparazzi/tree/calibration_xml in which you could split airframe.xml into 2 parts: a common ardrone part and a few specific ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why you need a separate airframe. See https://github.com/paparazzi/paparazzi/blob/master/conf/airframes/tudelft/origami_lisamxs_wifi_indi_stereoboard.xml for an example of how to set up a single airframe for ap and nps.
https://github.com/paparazzi/paparazzi/blob/master/conf/airframes/KS/ks_bebop2_stereo.xml shows an example with a bebop.
I also don't see how #2172 solves your issue. That PR only makes it easier to set the default environment from the flightplan. Currently, this can already be done with the NPS_GAZEBO_WORLD define in the airframe file.
All you have to do is correctly define the nps target in https://github.com/paparazzi/paparazzi/blob/master/conf/airframes/tudelft/bebop_orangeavoid_course2017.xml then you can run it in simulation.
As I mentioned before, the only possible issue is that the image might be a different size than on the real vehicle (the frame rate may also be different). The camera settings defined at the top of that airframe are not considered in nps yet, you will just get a fixed image with dimensions 320x240. This can be changed however, since #2158, sensors can now be added at runtime. So you could potentially make a bebop vehicle instead of the simple_x_quad which doesn't have cameras and add them at runtime with the correct settings. But none of this will be fixed by added a separate airframe.
Maybe if you describe why you need separate files in a bit more detail I can try to change nps to facilitate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirkscheper the flying airframe is a bebop1, the simulated one is an ARDrone. Both have not only different board but different pretty much everything. Merging the control gains into 1 file is not working for me. I tried to have gazebo fly with bebop gains but that did not work either.
@@ -430,6 +430,28 @@ | |||
gui_color="green" | |||
/> | |||
<aircraft | |||
name="ardrone2_flightplan_guided_gazebo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add simulation specific vehicles? The idea of the targets is that one airframe can be used for both real flight and simulation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Only: the orangeavoider runs in a bebop and gazebo does not simulate that yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are now 3 types of vehicles defined. ARdrone, simple_quad and simple_x_quad. If you would like a bebop specific vehicle you can add it and define the type in the airframe using NPS_GAZEBO_AC_NAME. I think it would be sufficient however just to use the default simple_x_quad though.
If you are referring to the resolution of the camera, the you would indeed need a new vehicle. Or wait till the end of the week when I implement a way to dynamically add sensors to the models and then add the bebop camera instead of the ardrone camera to the default drone.
One major thing that is not yet implemented that may affect the bebop integration is there are no actuator dynamics implemented to INDI doesn't work. What I have done so far is use INDI in ap and quat_int in nps. I think that this is a fine compromise for now though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the spaces in the world file you can use sed -i $'s/\t/ /g' *.sdf This will replace all tabs with spaces (easier to debug in github images, it is also the format that is used when writing the sdf files from the sdf library). |
d9eab03
to
ea9d5a7
Compare
will merge real and sim airframe as soon as #2170 is merged |
ea9d5a7
to
86dc18f
Compare
Did not work to simulate ardrone and ap bebop from 1 file. Once a bebop flies in Gazebo I'll update the course.
<module name="ins" type="extended"/> | ||
</firmware> | ||
|
||
<modules main_freq="512"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to move these modules to the firmware section ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is on purpose since that does not work as expected... still investigating. will fix this for all tudelft airframes once solved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this part
@@ -30,6 +31,31 @@ | |||
#define VERBOSE_PRINT(...) | |||
#endif | |||
|
|||
#ifndef ORANGE_AVOIDER_LUM_MIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these parameters should be described in the documentation of the module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
… call gzclient as tool
Conflicts: sw/airborne/modules/orange_avoider/orange_avoider.c
86dc18f
to
38eadca
Compare
* Gazebo Cyberzoo and OrangeAvoid in tudelft conf, Simulate when no RC, call gzclient as tool * [orange_avoider] color setting * docs+remove modules section
This code is being used in the TUDelft MAVLab course