PX4 In STEM Education: How We Taught A Thousand . - PX4 Autopilot

Transcription

PX4 in STEM education:How we taught a thousandstudents how to program drones

Origins (2013)WEB PAGECOPTEREXPRESS.COM

Pizza delivery inSyktyvkar (2014)WEB PAGECOPTEREXPRESS.COM

Pizza delivery inSyktyvkar (2014)WEB PAGECOPTEREXPRESS.COM

Autonomous deliveryin Samara (2016)WEB PAGECOPTEREXPRESS.COM

Autonomous deliveryin Samara (2016)WEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COM

Autonomousmonitoring UASVideo of chargingstationWEB PAGECOPTEREXPRESS.COM

Drones ineducationWEB PAGECOPTEREXPRESS.COM

Approaches toeducational drones RTF drones modular drones kits of common partsWEB PAGECOPTEREXPRESS.COM

Problems ofrobotics educationWEB PAGECOPTEREXPRESS.COMRobotics is a young field. It makes it so interesting,but for the same reason it's hard to learn.Alternatives: make something simple hide complexity make awesome documentation

WEB PAGECOPTEREXPRESS.COMvue.js docsROS docs

How to teachrobotics?Alternatives: make something simple hide complexity make awesome documentationWEB PAGECOPTEREXPRESS.COM

Our drone kitWEB PAGECOPTEREXPRESS.COM

Why “CLEVER”?WEB PAGECOPTEREXPRESS.COMКлевер /ˈklʲevʲir/ – clover

CLEVER 4 kitWEB PAGECOPTEREXPRESS.COM

Hardware & softwareWEB PAGECOPTEREXPRESS.COMElectric motor4 pcs.Propellers (couple)4 pcs.Speed controller ESC4 pcs.FramekitPower distributionboard with ingle-boardcomputerBatteries2 pcs.Machinevision cameraChargerAssembly manual,Training MaterialsLight-emittingdiode ingsimulator

Why PX4?WEB PAGECOPTEREXPRESS.COMAutopilot software requirements: flexibility necessary features (low-level control, indoorflights) not just firmware, but the full stack (groundcontrol, log analysing) simplicity stability community

Documentationclever.copterexpress.com/enWEB PAGECOPTEREXPRESS.COM

AdoptionWEB PAGECOPTEREXPRESS.COM

Path of studentWEB PAGECOPTEREXPRESS.COM

School school camps physics: maybe design & engineering: yes computer science: YES PLEASE WEWANNA CODE THE DRONEWEB PAGECOPTEREXPRESS.COM

School:benefits with dronesWEB PAGECOPTEREXPRESS.COM

CollegeWEB PAGECOPTEREXPRESS.COM«UAS Operating» educational standard for colleges

College:contests & competitionsWEB PAGECOPTEREXPRESS.COM

University:science & labsDrone as: a tool for education a platform for researchSubjects: estimation theory control theory computer vision, SLAM, ML WEB PAGECOPTEREXPRESS.COM

IROS 2019WEB PAGECOPTEREXPRESS.COM

IROS 2019WEB PAGECOPTEREXPRESS.COM

CommunityWEB PAGECOPTEREXPRESS.COM

TeamWEB PAGECOPTEREXPRESS.COM

Courses forteachers in RussiaWEB PAGECOPTEREXPRESS.COM

Courses forteachers in ChinaWEB PAGECOPTEREXPRESS.COM

SalesWEB PAGECOPTEREXPRESS.COMCLEVER 4AMOUNTSOLDCLEVER 3CLEVER 22000CLEVER 1kits1243967214kits20162017kitskits20182019YEAR

WEB PAGECOPTEREXPRESS.COMHow does open sourceimpact business?

Russian market ofeducational dronesCOEXClever 455 %GeoscanPioneer26 %copter.spaceZhu-Zha10 %EdcomEdDrone5%MAIFilin3%DroneshubAlfa1%WEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COMSoftware frameworkgoals

ArchitecturalApproachLibrary based (DroneKit) Easier to understand Install with simple pip installWEB PAGECOPTEREXPRESS.COMIPC based (ROS/MAVROS) Introspection & Debugging Visualization Logging Multiple nodes can access the samedata User program doesn’t start the entiresystem Different programming languages Transparently distributed

Positioning system GPS Motion Capture Onboard camera basedWEB PAGECOPTEREXPRESS.COM

Onboard camerabased navigationFiducial markers(ArUco)Optical flowWEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COMFlying in OFFBOARD

Raw MAVROSWEB PAGECOPTEREXPRESS.COMimport rospyfrom geometry msgs.msg import PoseStampedfrom mavros msgs.srv import CommandBool, SetModerospy.init node('flight')arming rospy.ServiceProxy('/mavros/cmd/arming', CommandBool)set mode rospy.ServiceProxy('/mavros/set mode', SetMode)pos sp pub rospy.Publisher('mavros/setpoint position/local', PoseStamped, queue size 1)lpos Nonedef pose callback(msg):global lposlpos msgrospy.Subscriber('/mavros/local position/pose', PoseStamped, pose callback)pos sp PoseStamped()pos sp.header.frame id 'map'pos sp.pose.orientation.w 1def publish setpoint(event):pos sp.header.stamp rospy.get rostime()pos sp pub.publish(pos sp)rospy.Timer(rospy.Duration(0.1), publish setpoint)# wait for local positionwhile lpos is None:rospy.sleep(0.1)# take off to 3 meterspos sp.pose lpos.posepos sp.pose.position.z 3rospy.sleep(1)set mode(base mode 0, custom mode 'OFFBOARD')rospy.sleep(1)arming(True)rospy.spin()

WEB PAGECOPTEREXPRESS.COMsimple offboard

Project templateWEB PAGECOPTEREXPRESS.COMimport rospyfrom clever import srvfrom std srvs.srv import Triggerrospy.init node('flight')get telemetry rospy.ServiceProxy('get telemetry', srv.GetTelemetry)navigate rospy.ServiceProxy('navigate', srv.Navigate)navigate global rospy.ServiceProxy('navigate global', srv.NavigateGlobal)set position rospy.ServiceProxy('set position', srv.SetPosition)set velocity rospy.ServiceProxy('set velocity', srv.SetVelocity)set attitude rospy.ServiceProxy('set attitude', srv.SetAttitude)set rates rospy.ServiceProxy('set rates', srv.SetRates)land rospy.ServiceProxy('land', Trigger)

Take OffWEB PAGECOPTEREXPRESS.COMnavigate(x 0, y 0, z 1, speed 0.5, frame id 'body', auto arm True)

Body FrameWEB PAGECOPTEREXPRESS.COM

Usage from BashWEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COMnavigate(x 0, y 2, z 0, speed 0.5, frame id 'body')

WEB PAGECOPTEREXPRESS.COMnavigate(x 0, y -2, z 0, speed 0.5, frame id 'body')

WEB PAGECOPTEREXPRESS.COMland()

WEB PAGECOPTEREXPRESS.COMfor i in range(2):navigate(x 0, y 0, z 0.8, speed 1, auto arm True, frame id 'body')rospy.sleep(4)navigate(x 0, y 2, z 0, speed 2, frame id 'body')rospy.sleep(4)navigate(x 0, y 0, z 1, speed 2, frame id 'body')rospy.sleep(4)navigate(x 0, y -2, z 0, speed 2, frame id 'body')rospy.sleep(4)navigate(x 0, y 0, z -1, speed 2, frame id 'body')rospy.sleep(4)

WEB PAGECOPTEREXPRESS.COMnavigate(x 0, y 0, z 1, frame id 'aruco 107')

WEB PAGECOPTEREXPRESS.COMnavigate(x 0, y 0, z 1, frame id 'aruco 225')

WEB PAGECOPTEREXPRESS.COMVPEVision Position Estimation

WEB PAGECOPTEREXPRESS.COMnavigate(x 0, y 0, z 1.5, speed 1, auto arm True, frame id 'body')rospy.sleep(8)navigate(x 0, y 2.56, z 1.5, speed 3, yaw 0, frame id 'aruco map')rospy.sleep(8)navigate(x 0, y 1.28, z 1.5, speed 1, yaw 0, frame id 'aruco map')rospy.sleep(8)land()

WEB PAGECOPTEREXPRESS.COMdef vertical circle():RADIUS 0.75 # mSPEED 0.5 # rad / sstart get telemetry(frame id 'aruco map')start stamp rospy.get rostime()r rospy.Rate(10)while not rospy.is shutdown():angle (rospy.get rostime() - start stamp).to sec() * SPEEDy start.y math.sin(angle) * RADIUSz start.z math.cos(angle) * RADIUSset position(x 0, y y, z z, frame id 'aruco map')if angle math.radians(720):breakr.sleep()

/get telemetryInput frame idOutput connectedarmedmodex, y, zlat, lonvx, vy, vzpitchrollyawpitch rateroll rateyaw ratevoltagecell voltageWEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COM

Lower level control/set velocity /set attitude /set rates WEB PAGECOPTEREXPRESS.COM

Flipdef flip():start get telemetry()set rates(thrust 1)rospy.sleep(0.2)WEB PAGECOPTEREXPRESS.COM# memorize starting position# bump upset rates(roll rate 30, thrust 0.2)while True:telem get telemetry()if -math.pi telem.roll -0.2:breakset position(x start.x, y start.y, z start.z, yaw start.yaw)# finish flip

FlipWEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COMRaspberry Pi Image

Building image QEMU based builder Configured network ROS Kinetic OpenCV Periphery drivers CLEVER software package Additional software TestsWEB PAGECOPTEREXPRESS.COM

Web interfaceWEB PAGECOPTEREXPRESS.COM

ButterflyWEB PAGECOPTEREXPRESS.COM

Web Video ServerWEB PAGECOPTEREXPRESS.COM

CIWEB PAGECOPTEREXPRESS.COM

WEB ess/clever

ProjectsWEB PAGECOPTEREXPRESS.COM

Drone showWEB PAGECOPTEREXPRESS.COM

Drone showWEB PAGECOPTEREXPRESS.COM

WarehouseinspectionWEB PAGECOPTEREXPRESS.COM

Spherical protectionWEB PAGECOPTEREXPRESS.COM

Spherical protectionWEB PAGECOPTEREXPRESS.COM

Spherical protectionWEB PAGECOPTEREXPRESS.COM

Spherical protectionWEB PAGECOPTEREXPRESS.COM

Drone warsWEB PAGECOPTEREXPRESS.COM

CopterHackWEB PAGECOPTEREXPRESS.COM

How we taught a thousandstudents how to program dronesWEB PAGECOPTEREXPRESS.COM

WEB PAGECOPTEREXPRESS.COMAndrei KorigodskiiAlexey ShlykovOleg KalachevCTOCOOLead k@copterexpress.com

Assembly manual, Training Materials . system Different programming languages Transparently distributed. WEB PAGE Positioning system COPTEREXPRESS.COM GPS Motion Capture Onboard camera based . . pos_sp PoseStamped() pos_sp.header.frame_id 'map' pos_sp.pose.orientation.w 1