@@ -52,14 +52,6 @@ DJISDKNode::dataBroadcastCallback()
5252 rc_publisher.publish (rc_joy);
5353 }
5454
55- // update device control info
56- if (data_enable_flag & DataBroadcast::DATA_ENABLE_FLAG ::A3_HAS_DEVICE )
57- {
58- std_msgs::UInt8 status_device;
59- status_device.data = vehicle->broadcast ->getSDKInfo ().deviceStatus ;
60- device_status_publisher.publish (status_device);
61- }
62-
6355 tf::Matrix3x3 R_FRD2NED ;
6456 tf::Quaternion q_FLU2ENU;
6557
@@ -571,13 +563,24 @@ DJISDKNode::publish50HzData(Vehicle* vehicle, RecvContainer recvFrame,
571563
572564 uint16_t data_enable_flag = vehicle->broadcast ->getPassFlag ();
573565
566+
574567 // update device control info
575- if (data_enable_flag & DataBroadcast::DATA_ENABLE_FLAG ::A3_HAS_DEVICE )
576- {
568+ // if (data_enable_flag & DataBroadcast::DATA_ENABLE_FLAG::A3_HAS_DEVICE)
569+ // {
570+ Telemetry::TypeMap<Telemetry::TOPIC_CONTROL_DEVICE >::type sdk_info =
571+ vehicle->subscribe ->getValue <Telemetry::TOPIC_CONTROL_DEVICE >();
577572 std_msgs::UInt8 status_device;
578- status_device.data = vehicle->broadcast ->getSDKInfo ().deviceStatus ;
573+ // status_device.data = vehicle->broadcast->getSDKInfo().deviceStatus;
574+ status_device.data = sdk_info.deviceStatus ;
575+ // TODO The underlying status changed, but we look for a value of 2. Fix this.
576+ // https://github.com/dji-sdk/Onboard-SDK/issues/528
577+ // Jeff's farewell Mary Poppins
578+ if (status_device.data == 4 ){
579+ status_device.data = 2 ;
580+ ROS_INFO_THROTTLE (1 ," **UNDER AM CONTROL**" );
581+ }
579582 p->device_status_publisher .publish (status_device);
580- }
583+ // }
581584}
582585
583586
0 commit comments