paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [paparazzi/paparazzi] 9d1e71: Add Gazebo simulation


From: GitHub
Subject: [paparazzi-commits] [paparazzi/paparazzi] 9d1e71: Add Gazebo simulation to NPS (#2069)
Date: Tue, 13 Jun 2017 13:12:14 -0700

  Branch: refs/heads/master
  Home:   https://github.com/paparazzi/paparazzi
  Commit: 9d1e71b1ea1430dfa0439fcb815a1e87f0ecb5c0
      
https://github.com/paparazzi/paparazzi/commit/9d1e71b1ea1430dfa0439fcb815a1e87f0ecb5c0
  Author: tomvand <address@hidden>
  Date:   2017-06-13 (Tue, 13 Jun 2017)

  Changed paths:
    M .gitignore
    M conf/Makefile.nps
    A conf/airframes/examples/ardrone2_gazebo.xml
    M conf/conf_example.xml
    M conf/modules/cv_colorfilter.xml
    A conf/modules/fdm_gazebo.xml
    M conf/modules/video_rtp_stream.xml
    A conf/simulator/gazebo/models/ardrone/ardrone.sdf
    A conf/simulator/gazebo/models/ardrone/model.config
    A conf/simulator/gazebo/world/ardrone.world
    M sw/airborne/boards/pc_sim.h
    M sw/airborne/modules/computer_vision/video_thread_nps.c
    A sw/airborne/modules/computer_vision/video_thread_nps.h
    R sw/airborne/modules/computer_vision/viewvideo_nps.c
    A sw/simulator/nps/nps_fdm_gazebo.cpp

  Log Message:
  -----------
  Add Gazebo simulation to NPS (#2069)

* Setup code for Gazebo

Currently only partially initializes the fdm struct, which produces
incorrect results in the GCS.
Compilation, however, already seems to work as expected!

Next step is to fetch data from Gazebo.

* Closed-loop flight in Gazebo

Finished the first implementation of the Gazebo FDM. It is now possible
to perform closed-loop flights using Paparazzi together with Gazebo.

Look at the example_ardrone2.xml airframe file for the required gazebo tags.
The following modifications are made:
- change fdm type to "gazebo"
- add definitions for ACTUATOR_THRUSTS and ACTUATOR_TORQUES. These were
  obtained from the JSBsim ardrone model. The oredr is the same as the
  ACTUATOR_NAMES.

The Gazebo world needs an aircraft model that is (by default) named
"paparazzi_uav". This model should include links with the names listed
in ACTUATOR_NAMES in the airframe file, as these are used to apply
forces on the quadrotor.

Known bugs:
- No fixed wing aircraft yet.
- Not all fields in the fdm struct are set. Most of the atmosphere
  fields are not implemented yet.
- AHRS and INS need to be bypassed, these do not yet work correctly.
- No quadrotor models are supplied with paparazzi yet (although it is
  included in the example world file).

* Added cameras, but sensor update causes crash

As in the quick standalone examples, gazebo regularly crashes when
cameras are used.

This is an intermediary commit where most of the camera infrastructure
is present, but not functional yet because of an unknown bug regarding
Gazebo.

* Simplified problem, located crash

Crash occurs when gazebo::sensors::run_once() is called during
the fdm update step. The exception (Ogre internal exception,
cannot create GL vertex buffer) only occurs after the main loop
has been performed a few times (10-20x typically).

Ignoring the error by catching the exception does not make it go
away.

* Add ogre to fdm_gazebo makefile

* Further changes for debugging, not fixed yet

* FIX bug

Turns out that fdm_init and fdm_run_step are not running in the same
thread, which apparently caused some problems with Gazebo.

The gazebo initialization code that starts the server is now moved
to the run_step function, and cameras work fine now.

Next step is to get the images from Gazebo to the video_thread_nps module.

* Transport images to Paparazzi

Added code that converts Gazebo's RGB888 images to Paparazzi's
YUV422 format, and calls the registered video callbacks.

* Finish video streaming

Finished video streaming. Video streaming in the paparazzi master
branch does not seem to work in simulation or even on a real ardrone.
Therefore, reverted to v5.10 viewvideo.c and rtp.c and now the streaming
works correctly.

* Separate UAV model from world.

Added a models/ directory to conf/simulator/gazebo, now the UAV model
can be included in the world file. The models/ dir is added to Gazebo's
search paths when the server is launched, so it does not require
any additional steps from the user.

* Move Gazebo modifications from examples/ardrone2.xml to 
examples/ardrone2_gazebo.xml

Reverted changes to the original airframe and moved these to a
separate example.

* Remove .sdp file

Remove .sdp file that should not have been included with commits.

* Move changes in conf_example.xml to separate entry

Moved the changes to conf_example.xml (selected flightplan, modules etc.)
to a separate etry named 'ardrone2 (Gazebo)'.

* Clean up changes to computer_vision module

- Removed unused viewvideo_nps.c.
- Add doc comments in video_thread_nps.c

* Fix bug in conf_example

Spaces in aircraft name caused compilation error, changed to
'ardrone2_gazebo'.

* Fix duplicate ac_id in conf_example

* Remove debug code from nps_fdm_gazebo.cpp and add comments

* Reduce weight of cameras

Cameras weighed 10 grams, which was quite much. Now reduced to 1 gram.

* Fix camera not active

During the cleanup of the ardrone gazebo model, the always_on tag
was removed. Now, the cameras are activated during gazebo_video_init

Also removed further debug code from nps_fdm_gazebo.cpp.

* Restore master branch video streamer and rtp encoder

The streamer of the master branh does not work correctly atm, but
this will be moved to a separate issue.

* Fix compilation warnings

Fixed all compilation warnings (tested with Gazebo 8).

Unused arguments are now marked as such.

The NPS makefile is modified to use CXXFLAGS in addition to CFLAGS,
which solves the std=c++11 related warnings.

fdm_gazebo.cpp now ignores deprecated warnings, as all of these
come from Gazebo. Not the cleanest solution, but it works for now.

* Add documentation to fdm module xml and add copyright notices where 
appropriate

* Fix code style

Fixed code style using the tool included with paparazzi.

* Fix missing model.config

.gitignore caused the model.config files for the Gazebo models to
be excluded from the commit. Added an exception to .gitignore and
added the missing file.

* Fix INS by adding placeholder atmospheric data values

Added placeholder values to the atmospheric section of the NPM
struct. These should be valid for low altitude, low speed flights.

Previously, these values were uninitialized which caused INS to fail
(incorrect altitude estimates). With these placeholder values,
the INS works ok and no longer needs to be bypassed.

* Fix makefile targets in video_rtp_stream and cv_colorfilter

(Re)added target="ap|nps" attribute to the module .xml files.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]