Skip to content
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

Merged
merged 4 commits into from
Nov 9, 2017

Conversation

kevindehecker
Copy link
Contributor

@kevindehecker kevindehecker commented Oct 30, 2017

This code is being used in the TUDelft MAVLab course

Copy link
Member

@kirkscheper kirkscheper left a 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">
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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"
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirkscheper
Copy link
Member

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).

@dewagter dewagter mentioned this pull request Nov 7, 2017
23 tasks
@dewagter dewagter force-pushed the mavlabCourseSimulator branch 2 times, most recently from d9eab03 to ea9d5a7 Compare November 7, 2017 10:32
@dewagter
Copy link
Member

dewagter commented Nov 7, 2017

will merge real and sim airframe as soon as #2170 is merged

@dewagter dewagter dismissed kirkscheper’s stale review November 7, 2017 22:02

Did not work to simulate ardrone and ap bebop from 1 file. Once a bebop flies in Gazebo I'll update the course.

@dewagter dewagter self-assigned this Nov 7, 2017
<module name="ins" type="extended"/>
</firmware>

<modules main_freq="512">
Copy link
Member

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 ?

Copy link
Member

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.

Copy link
Member

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
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Conflicts:
	sw/airborne/modules/orange_avoider/orange_avoider.c
@dewagter dewagter merged commit 6fafcaa into paparazzi:master Nov 9, 2017
@dewagter dewagter deleted the mavlabCourseSimulator branch November 9, 2017 18:45
@dewagter dewagter restored the mavlabCourseSimulator branch November 13, 2017 19:07
biancabndris pushed a commit to biancabndris/paparazzi that referenced this pull request Aug 29, 2018
* Gazebo Cyberzoo and OrangeAvoid in tudelft conf, Simulate when no RC, call gzclient as tool
* [orange_avoider] color setting

* docs+remove modules section
@dewagter dewagter deleted the mavlabCourseSimulator branch February 13, 2023 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants