Morse
Morse is a generic simulator for academic robotics. It focuses on realistic 3D simulation of small to large environments, indoor or outdoor, with one to tenths of autonomous robots.
For Paparazzi, it can be used as a 3D visualization interface when flying a rotorcraft, either in simulation and real flights. The main purpose of Morse is to be able to simulate many sensors and get their feedback from the virtual environment.
Once you have completed the installation of Morse, you may need to install lxml for python3 (from distribution package if available), plus ivy and pprzlink from source (python3 packages are not available, but source code is compatible). Don't forget to set properly your PYTHONPATH environment variable for manually installed libraries.
After creating your simulation environment with the command (you can choose a different project name)
morse create my_pprz_env
you can change the default.py script newly created in the my_pprz_env folder as follow to initiate connection between Morse and Paparazzi
#! /usr/bin/env morseexec """ Basic MORSE simulation scene for <test_pprz> environment Feel free to edit this template as you like! """ from morse.builder import * robot = Quadrotor() # The list of the main methods to manipulate your components # is here: http://www.openrobots.org/morse/doc/stable/user/builder_overview.html robot.translate(0.0, 0.0, 0.0) robot.rotate(0.0, 0.0, 0.0) # Add a motion controller motion = Teleport() robot.append(motion) motion.add_stream('pprzlink') #motion.add_stream('pprzlink', ac_id=101) (if you need to specify the aircraft ID) env = Environment('indoors-1/boxes', fastmode = False)
The Teleport actuator is the only one natively supported for Paparazzi at the moment, and it allows to replicate the position and orientation of the real/simulated UAV into the Morse virtual world. In addition, some other sensors can be added but will use one of the other supported middlewares. Here is an example of a video camera using the socket interface:
video = VideoCamera() video.translate(0., 0., 0.1) video.rotate(0., 0., 0.) robot.append(video) motion.add_stream('socket') video.add_interface('socket')