flying penguins
play

Flying Penguins Embedded Linux applications for autonomous - PowerPoint PPT Presentation

Flying Penguins Embedded Linux applications for autonomous UAVs Clay McClure github.com/claymation Roadmap MAV Your UAV mavros Link App ROS Linux autopilot autopilots autopilots RC input motor mixing


  1. Flying Penguins Embedded ¡Linux ¡applications ¡ for ¡autonomous ¡UAVs

  2. Clay McClure github.com/claymation

  3. Roadmap MAV Your UAV mavros Link App ROS Linux

  4. autopilot

  5. autopilots

  6. autopilots

  7. RC input motor mixing stabilization telemetry missions failsafes

  8. AUTO ≠ AUTO PILOT NOMOUS

  9. “system finds its own goal positions” where to go how to get there what to do next

  10. SO MANY ALGORITHMS, SO LITTLE COMPUTER http://ra3ndy.deviantart.com/art/Sad-Panda-69204875

  11. +

  12. Autopilot runs on Linux

  13. Autopilot talks to Linux

  14. ODROID-XU3 Lite • Samsung Exynos5422 octa core • 4x Cortex™-A15 2.0GHz • 4x Cortex™-A7 1.4GHz • 2 GB RAM • 32+ GB flash • 4x USB 2.0 + 1x USB 3.0

  15. Roadmap (so far) ? Your UAV App Linux

  16. Roadmap (so far) MAV Your UAV Link App Linux

  17. MAVLink is the HTTP of drones

  18. (it’s also the libcurl)

  19. MAVLink

  20. status configuration position / attitude setpoints missions

  21. Roadmap (so far) ? MAV Your UAV Link App Linux

  22. Roadmap (so far) MAV Middle Your UAV Link ware App Linux

  23. Middleware DroneAPI • Python • Go to Kevin Hester’s talk tomorrow mavros • Python, C++, Lisp (really) • Access to a wealth of robotics research and tools

  24. Roadmap (so far) MAV Your UAV mavros Link App ? Linux

  25. Roadmap (so far) MAV Your UAV mavros Link App ROS Linux

  26. ROS Crash Course

  27. Robot Operating System “ROS is an open-source, meta-operating system for your robot.”

  28. Robot Operating System “ROS is an open-source, meta-operating system for your robot.”

  29. Nodes Node Node Node Node Node Node Node Node Node

  30. Topics Node Topic Node Node Node

  31. Services Node Node

  32. but wait, that’s not all… parameters dynamic reconfig coordinate frames transformations record/playback visualization logging

  33. Roadmap MAV Your UAV mavros Link App ROS Linux

  34. mavros is the Babel fish of drones

  35. Topics /mavros/state /mavros/imu/data /mavros/global_position/global /mavros/local_position/local /mavros/setpoint_position/local_position /mavros/setpoint_velocity/cmd_vel

  36. Services /mavros/cmd/arming /mavros/cmd/land /mavros/cmd/takeoff /mavros/set_mode /mavros/set_stream_rate

  37. PX4 + ROS • FCU • MAVLink • mavros • ROS • Application nodes Credit: Kabir Mohammed

  38. Roadmap MAV Your UAV mavros Link App ROS Linux

  39. YAPL Yet Another Precision Lander

  40. Event-driven programming • “Don’t call me, I’ll call you” • Your application code responds to events • Message arrival • “my position is (x, y, z)” • Timer expiry • “it’s time to run the control loop”

  41. Nodes • Tracker • Processes video stream, looks for landing pad • Publishes target position/velocity messages • Commander • Subscribes to vehicle state and position messages • Subscribes to target tracker messages • Controls vehicle velocity

  42. class ¡TrackerNode(object): ¡ � ¡ ¡ ¡ ¡def ¡__init__(self): ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rospy.init_node("tracker") ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡use_sim ¡= ¡rospy.get_param("~use_sim", ¡False) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡camera_matrix ¡= ¡rospy.get_param("~camera_matrix") ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡# ¡... ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡self.image_publisher ¡= ¡\ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rospy.Publisher("tracker/image", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡sensor_msgs.msg.Image, ¡queue_size=1) ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡self.track_publisher ¡= ¡\ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rospy.Publisher("tracker/track", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Track, ¡queue_size=1)

  43. class ¡TrackerNode(object): ¡ � ¡ ¡ ¡ ¡def ¡__init__(self): ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rospy.init_node("tracker") ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡use_sim ¡= ¡rospy.get_param("~use_sim", ¡False) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡camera_matrix ¡= ¡rospy.get_param("~camera_matrix") ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡# ¡... ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡self.image_publisher ¡= ¡\ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rospy.Publisher("tracker/image", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡sensor_msgs.msg.Image, ¡queue_size=1) ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡self.track_publisher ¡= ¡\ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡rospy.Publisher("tracker/track", ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Track, ¡queue_size=1)

  44. $ ¡cat ¡msg/Track.msg ¡ ¡ # ¡Whether ¡we're ¡tracking ¡an ¡object ¡ std_msgs/Bool ¡is_tracking ¡ � # ¡Relative ¡position ¡and ¡velocity ¡of ¡the ¡tracked ¡object ¡ geometry_msgs/Vector3 ¡position ¡ geometry_msgs/Vector3 ¡velocity ¡

  45. ¡ ¡ ¡ ¡def ¡publish_track(self, ¡position, ¡velocity): ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg ¡= ¡TrackStamped() ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.is_tracking.data ¡= ¡self.is_tracking ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡if ¡self.is_tracking: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.position.x ¡= ¡position[0] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.position.y ¡= ¡position[1] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.position.z ¡= ¡position[2] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.velocity.x ¡= ¡velocity[0] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.velocity.y ¡= ¡velocity[1] ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg.track.velocity.z ¡= ¡velocity[2] ¡ � ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡self.track_publisher.publish(msg) ¡

  46. ¡ ¡ ¡ ¡def ¡publish_image(self, ¡image): ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡msg ¡= ¡self.image_bridge.cv2_to_imgmsg(image, ¡"bgr8") ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡self.image_publisher.publish(msg) ¡

  47. simulation

  48. HITL • Hardware in the loop • Flight software runs on flight hardware • Simulated sensor and control inputs

  49. SITL • Software in the loop • Flight software runs on (Linux) desktop • Simulated sensor and control inputs and HAL

  50. 
 “In theory there is no difference between theory and practice. “Type a quote here.” In practice there is.” � ~ Yogi Berra –Johnny Appleseed

  51. Practical Considerations

  52. Connections • UART recommended • Requires 6-pin DF-13, possibly a level shifter • USB works for me • Use hot glue gun • sudo ¡apt-­‑get ¡remove ¡modemmanager

  53. Power 5V 5A UBEC � ODROID + USB camera + WiFi + 3S LiPo = 5 hours

  54. Launch files • ROS feature that makes it easy to start and manage multiple nodes and their parameters • roslaunch ¡lander ¡lander.launch

  55. Startup • Use ubuntu’s upstart to launch ROS + mavros + application nodes • rosrun ¡robot_upstart ¡install ¡\ 
 ¡ ¡ ¡ ¡lander/launch/lander.launch

  56. Telemetry • MAVLink + 3DR radio • WiFi • Ad-Hoc mode ( man ¡wireless ) • Need high-gain antenna and a tracker (helper) • sudo ¡apt-­‑get ¡remove ¡wpasupplicant ¡ • GSM?

  57. Coordinate Frames • Global / Local • NED • ENU • Body-fixed • tf library

  58. In closing…

  59. What will you make?

  60. For more information… ros.org ardupilot.com pixhawk.org/start pixhawk.ethz.ch/mavlink github.com/mavlink/mavros github.com/claymation/lander

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