Open tngan opened 6 years ago
@tngan Yeah I managed to send data to my mobile device. Unfortunately, I'm currently on holiday an d I didn't push the latest version to Github. I don't call ros services directly. I start the ros service within my own implementation based on this sample provided by DJI here. I then recieve data using a background thread and calling setOnboardSDKDeviceDataCallback
in the doc you linked above
@InterestingWalrus Thanks for your quick reply. Is it possible to send arbitrary data instead of those predefined actions (e.g. landing, takeoff, etc) in your implementation ?
For data transparent transmission, it mentioned the CMD set is 0x00 and id is 0xFE here, but I don't know where to define the CMD set.
Updates:
I think we can set it when we define the ServiceAck here. So It's possible to transmit arbitrary data, it's worth to try.
You can send bytes using SendDatatoOnboardSDKDevice.
On 18 Mar 2018 04:50, "Tony Ngan" notifications@github.com wrote:
@InterestingWalrus https://github.com/interestingwalrus Thanks for your quick reply. Is it possible to send arbitrary data instead of those predefined actions (e.g. landing, takeoff, etc) in your implementation ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/InterestingWalrus/matrice_autonomy/issues/1#issuecomment-373972897, or mute the thread https://github.com/notifications/unsubscribe-auth/AcRPp6UcH5SOm37gsXcCFquIpR06UCkmks5tfeeLgaJpZM4Suwjv .
@InterestingWalrus SendDatatoOnboardSDKDevice
is for upstream from mobile to OES. However, I am working on the downstream from OES back to mobile, the example code of the ROS service call should be something like:
dji_sdk::SendMobileData mobile_data;
CmdToMobile cmdMobile;
cmdMobile.cmdSet = 0; // 0x00
cmdMobile.cmdID = 254; // 0xFE for data transparent transmission
mobile_data.request.data.resize(sizeof(CmdToMobile));
memcpy(&mobile_data.request.data[0], (uint8_t *)(&cmdMobile), sizeof(CmdToMobile));
mobile_data_service.call(mobile_data);
CmdToMobile is defined as
typedef struct CmdToMobile{
uint8_t cmdSet; // 1 byte
uint8_t cmdID; // 1 byte
uint8_t[] cmdVal; // should be less than 100 bytes
} CmdToMobile
Does it make sense ?
Yeah that looks about right.
On 18 Mar 2018 07:22, "Tony Ngan" notifications@github.com wrote:
@InterestingWalrus https://github.com/interestingwalrus SendDatatoOnboardSDKDevice is for upstream from mobile to OES. However, I am working on the downstream from OES back to mobile, the example code of the ROS service call should be something like:
dji_sdk::SendMobileData mobile_data; CmdToMobile cmdMobile; cmdMobile.cmdSet = 0; // 0x00 cmdMobile.cmdID = 254; // 0xFE for data transparent transmission mobile_data.request.data.resize(sizeof(CmdToMobile));memcpy(&mobile_data.request.data[0], (uint8_t *)(&cmdMobile), sizeof(CmdToMobile)); mobile_data_service.call(mobile_data);
CmdToMobile is defined as
typedef struct CmdToMobile{ uint8_t cmdSet; // 1 byte uint8_t cmdID; // 1 byte uint8_t[] cmdVal; // should be less than 100 bytes } CmdToMobile
Does it make sense ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/InterestingWalrus/matrice_autonomy/issues/1#issuecomment-373977977, or mute the thread https://github.com/notifications/unsubscribe-auth/AcRPpy7f8n_M61yFErmiUVFbNt8hmsgxks5tfgsmgaJpZM4Suwjv .
@InterestingWalrus Cool, will give it a try today.
@tngan , did you manage to fix your issue, I updated to the latest version of the DJI SDK and I can't also seem to receive data on a mobile device.
Hi @InterestingWalrus, I am also working on the sample for exchanging the data in between mobile and onboard sdk through data transparent transmission mentioned in DJI's documentation. have you tried to receive the data in mobile ?
I have found a doc to implement the delegate, but it doesn't work though when I directly call the service with ros command.