the sphinx simulator project
play

The sphinx simulator project Nicolas CARRIER April, 6, 2016 The - PowerPoint PPT Presentation

The sphinx simulator project Nicolas CARRIER April, 6, 2016 The sphinx simulator project 1 / 32 Presentation The problem Overview Features Limitations Architecture Firmwared The fjrmwares Gazebo Conclusion The sphinx simulator project


  1. The sphinx simulator project Nicolas CARRIER April, 6, 2016 The sphinx simulator project 1 / 32

  2. Presentation The problem Overview Features Limitations Architecture Firmwared The fjrmwares Gazebo Conclusion The sphinx simulator project 2 / 32

  3. The problem Parrot: Problem: The sphinx simulator project 3 / 32 ▶ Builds wireless devices since 1994, bluetooth, WiFi... ▶ First commercial drone, the AR.Drone in 2010 ▶ Linux based drones, custom distribution ▶ Located in the center of Paris ▶ No accessible zone to fmy drones ▶ How to develop something like fmight plans ? ▶ How to test big drones ? Flying wings ?

  4. Overview Sphinx: The sphinx simulator project 4 / 32 ▶ French word for the death head hawk moth ▶ It’s the one which fmies, not the one which asks questions ▶ Means Simulator Project Hopefully Implemented for Next Xmas ▶ Originally an internal tool for development / automatic testing ▶ Team created in february 2015, fjrst usable release in fall

  5. Features 1/3 The sphinx simulator project 5 / 32 ▶ Based on gazebo ▶ Mostly open-source (more on that later) ▶ Allows to test nearly original Parrot drone fjrmwares ▶ There’ll always be a Next Xmas -> no deadline missed, never

  6. Features 2/3 Even for autonomous tests in Jenkins CI servers The sphinx simulator project 6 / 32 ▶ Support for Bebop, Bebop 2, Rolling Spider, Disco ▶ Partial support for our top secret future drones ▶ Integration of WiFi, Bluetooth ▶ Uses exprtk, for easier models tweaking ▶ Support for multiple drones in the same simulation ▶ Seamless use for any controller above the SDK

  7. Features 3/3 Used for: Who knows... The sphinx simulator project 7 / 32 ▶ Development of new features (fmightplan), debug ▶ Fine-tune our drone control algorithms ▶ Autonomous regression tests ▶ Manual validation tests ▶ Discussions ongoing for a public release for app developers ▶ One day for the training of our FPV racing team ?

  8. Limitations but things are getting simpler as we support more and more drones The sphinx simulator project 8 / 32 ▶ Runs on Linux only ▶ Firmware adaptations are not trivial ▶ Not strictly the original fjrmware ▶ Not fully deterministic

  9. Architecture 3 main parts The sphinx simulator project 9 / 32 ▶ Gazebo + some custom plug-ins ▶ A fjrmware, adapted and recompiled for x86 / amd64 ▶ Firmwared (https://github.com/ncarrier/fjrmwared-manifest)

  10. Architecture The sphinx simulator project 10 / 32

  11. Presentation Firmwared Presentation Control OverlayFS Namespaces AppArmor The fjrmwares Gazebo Conclusion The sphinx simulator project 11 / 32

  12. Presentation System daemon responsible of spawning instances of drones fjrmwares. root privileges... (more on that later) The sphinx simulator project 12 / 32 ▶ Firmware’s programs run as if they were on a target ▶ Implements containers ”by hand” for a basic isolation ▶ Chroot on overlayfs ▶ Namespaces ▶ Apparmor ▶ Firmwares ext2 fjlesystem images or a ”fjnal” directories ▶ Multiple instances can be spawned from a single fjrmware ▶ Open-source (see Parrot-Developer’s github)

  13. Control Marshalling API with an a-la-printf protocol ° shell: fdc based on pomp-cli, complete ° C++ gazebo plug-in: fwman The sphinx simulator project 13 / 32 ▶ Driven by a named unix socket ▶ Uses libpomp (https://github.com/Parrot-Developers/libpomp) ▶ Two clients:

  14. Example $ fdc prepare firmwares /.../final ... the firmware garrulous_bellatrix has been created $ fdc prepare instances garrulous_bellatrix ... the instance tremulous_nevena has been created $ fdc start tremulous_nevena ... The sphinx simulator project 14 / 32

  15. can be used for postmortem analysis OverlayFS The sphinx simulator project 15 / 32 ▶ An RW layer on top of an RO one (the rootfs) ▶ The RO layer is preserved and can be ▶ the rootfs produced by the compilation (fjnal dir) ▶ an ext2 image, produced from the fjnal by Alchemy ▶ the RW layer contains the difg on the fjle system, due to the execution:

  16. OverlayFS The sphinx simulator project 16 / 32

  17. Namespaces Unshare some global resources to protect their access from inside an instance (read: when the instance’s pid 1 dies) The sphinx simulator project 17 / 32 ▶ Network namespace ▶ No impact on the host’s networking ▶ An interface can be stolen for the instance (WiFi AP) ▶ Pid namespace ▶ Renumbering of processes, starting from 1 in the namespace ▶ Our init process (fork of Android’s) runs as if on target ▶ Mount namespace ▶ No access from the host to the instance’s mount points ▶ No access from the instance to the host’s mount points ▶ All mounts are automatically unmounted when the namespace is destroyed

  18. => we managed to use it ! AppArmor The sphinx simulator project 18 / 32 ▶ Some other global resources are still shared ▶ AppArmor allows to restrict their access, for example: ▶ Capabilities (sys_time, hahem...) ▶ Filesystem entities (/dev/mem, /proc/sysrq-trigger, hahem...) ▶ Uses a shell-like ”glob” syntax

  19. Presentation Firmwared The fjrmwares Content Gazebo Conclusion The sphinx simulator project 19 / 32

  20. Content 1/2 Our build system is Alchemy The sphinx simulator project 20 / 32 ▶ Produces a ”full” root fs: the staging (with symbols, headers...) ▶ Produces a stripped down rootfs for use on target: the fjnal ▶ From this fjnal, fjrmware images are produced, in plf, ext2, tar.gz... ▶ Firmwared can use directly a fjnal directory or an ext2 image

  21. Content 2/2 The fjrmware’s variant used in the simulator has: Pros: Cons: The sphinx simulator project 21 / 32 ▶ Difgerent hardware access code (IPC with gazebo) ▶ Difgerent startup / initialization sequence (not the same ”hardware”) ▶ All the rest of the code is (or can be...) the same ▶ No kernel level development ▶ Negligible impact on performances ▶ Not the exact same code and code path as a real fjrmware ▶ Maintenance burden (2 variants of one fjrmware)

  22. Other methods the same code paths anyway The sphinx simulator project 22 / 32 ▶ Full virtualization ▶ High impact on performances ▶ Drivers using IPCs with gazebo would be needed ▶ Qemu ”transparent” emulation: incomplete (netlink) ▶ Pseudo-hardware in the loop ▶ Soft runs on hardware with IPCs via IP ▶ No recompilation, same code with runtime adaptations, but lot of work and not ▶ Latency and throughput problems (e.g. video) gzserver needs to run on target ▶ Hardware in the loop ▶ It’s the holy grail: test the real fjrmware on a desktop ▶ Forces to develop an hardware device per sensor / actuator ▶ Not so hard for a gpio, but for a camera sensor ? ▶ High cost for fjrst version ▶ My bet (and hope) is: we will come to it

  23. Presentation Firmwared The fjrmwares Gazebo Overview Plug-ins Simulation description Conclusion The sphinx simulator project 23 / 32

  24. Overview project The sphinx simulator project 24 / 32 ▶ Gzserver simulates a world, including models with physical interactions ▶ Plug-ins system world, model and gui ▶ Gzclient optional client for real-time opengl visualization ▶ Open-source, C++ ▶ XML description (sdf) of simulation and models ▶ We use a modifjed gazebo 7 with some added features, given back to the

  25. Plug-ins Model plug-ins: World plug-ins: Gui plug-in: The sphinx simulator project 25 / 32 ▶ One per sensor / actuator ▶ IPC with gazebo: named socket ▶ no IP overhead ▶ abstract sockets blocked by netns ▶ for now all of them use iio / libiio ▶ fwman: client controlling fjrmwared ▶ aerodynamic ▶ wind ▶ shake: gui plugin for Disco’s take ofg sequence

  26. World fjles The sphinx simulator project 26 / 32 ▶ Normal sdf fjles ▶ References the fwman plugin ▶ Include no drone models, but reference to the fjrmwares used

  27. Drone model fjles e.g. same body, difgerent hulls this way, fjrmware and model are kept in sync The sphinx simulator project 27 / 32 ▶ Sdf fjles + xinclude for factoring ▶ Embedded inside the fjrmware ▶ References the actuators and sensors plug-ins

  28. Simulation description The sphinx simulator project 28 / 32 ▶ Analysis of a world ▶ Analysis of a model

  29. Presentation Firmwared The fjrmwares Gazebo Conclusion The sphinx simulator project 29 / 32

  30. Demonstration The sphinx simulator project 30 / 32

  31. Ongoing and potential work Ongoing: Potential: The sphinx simulator project 31 / 32 ▶ Video support ▶ Advanced vision features, follow me ... ▶ RC support ▶ Visual feedback for leds ▶ HIL ? (fjnger crossed !)

  32. Thank you for your attention The sphinx simulator project 32 / 32

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend