File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ class Crazyflie
158158 std::string getFirmwareVersion ();
159159
160160 std::string getDeviceTypeName ();
161+
162+ void sendArmingRequest (bool arm);
163+
161164 void logReset ();
162165
163166 void sendSetpoint (
@@ -764,6 +767,8 @@ class CrazyflieBroadcaster
764767 return m_connection.statisticsDelta ();
765768 }
766769
770+ void sendArmingRequest (bool arm);
771+
767772 // High-Level setpoints
768773 void takeoff (float height, float duration, uint8_t groupMask = 0 );
769774
Original file line number Diff line number Diff line change @@ -1008,6 +1008,13 @@ struct crtpGetDeviceTypeNameResponse
10081008 static std::string name (const bitcraze::crazyflieLinkCpp::Packet &p);
10091009};
10101010
1011+ class crtpArmingRequest
1012+ : public bitcraze::crazyflieLinkCpp::Packet
1013+ {
1014+ public:
1015+ crtpArmingRequest (bool arm);
1016+ };
1017+
10111018// Port 15 (Link)
10121019class crtpLatencyMeasurementRequest
10131020 : public bitcraze::crazyflieLinkCpp::Packet
Original file line number Diff line number Diff line change @@ -108,6 +108,12 @@ std::string Crazyflie::getDeviceTypeName()
108108 return res::name (p);
109109}
110110
111+ void Crazyflie::sendArmingRequest (bool arm)
112+ {
113+ crtpArmingRequest req (arm);
114+ m_connection.send (req);
115+ }
116+
111117void Crazyflie::logReset ()
112118{
113119 crtpLogResetRequest request;
@@ -1215,6 +1221,13 @@ CrazyflieBroadcaster::CrazyflieBroadcaster(
12151221 : m_connection (link_uri)
12161222{
12171223}
1224+
1225+ void CrazyflieBroadcaster::sendArmingRequest (bool arm)
1226+ {
1227+ crtpArmingRequest req (arm);
1228+ m_connection.send (req);
1229+ }
1230+
12181231void CrazyflieBroadcaster::takeoff (float height, float duration, uint8_t groupMask)
12191232{
12201233 crtpCommanderHighLevelTakeoffRequest req (groupMask, height, duration);
Original file line number Diff line number Diff line change @@ -293,6 +293,13 @@ std::string crtpGetDeviceTypeNameResponse::name(const bitcraze::crazyflieLinkCpp
293293 return p.payloadAtString (1 );
294294}
295295
296+ crtpArmingRequest::crtpArmingRequest (bool arm)
297+ : Packet(13 , 0 , 2 )
298+ {
299+ setPayloadAt<uint8_t >(0 , 1 );
300+ setPayloadAt<uint8_t >(1 , arm);
301+ }
302+
296303#if 0
297304crtpFullStateSetpointRequest::crtpFullStateSetpointRequest(
298305 float x, float y, float z,
You can’t perform that action at this time.
0 commit comments