dji-sdk / RoboMaster-SDK

DJI RoboMaster Python SDK and Sample Code for RoboMaster EP.
Apache License 2.0
312 stars 141 forks source link

Using plaintext protocol, command format error; command parse error; #58

Closed WinRobotics closed 2 years ago

WinRobotics commented 2 years ago

Hi,

I am facing some issues with using the UART to manually send serial commands into the Robomaster EP.

I am facing this issue when:

[input] command; [output] ok; [input] chassis move x 0.1 y 0.0 z 0.0;


robot moves 0.1m

[input] chassis move x 0.1 y 0.0 z 0.0; [again] [output] command formart error; command parse error

i have checked the documentations inside the SDK but nothing was mentioned. Wondering if there is a need to send back a "ACK/OK" kind of message back to the robomaster ? or is there some timing conditions need to be fulfilled

brunoga commented 2 years ago

Might have been a typo, but your last command is missing a semicolon (;) at the end.

On Thu, Dec 23, 2021 at 2:06 PM Sherwin Fun @.***> wrote:

Hi,

I am facing some issues with using the UART to manually send serial commands into the Robomaster EP.

I am facing this issue when:

[input] command; [output] ok; [input] chassis move x 0.1 y 0.0 z 0.0;

robot moves 0.1m

[input] chassis move x 0.1 y 0.0 z 0.0 [again] [output] command formart error; command parse error

i have checked the documentations inside the SDK but nothing was mentioned. Wondering if there is a need to send back a "ACK/OK" kind of message back to the robomaster ? or is there some timing conditions need to be fulfilled

— Reply to this email directly, view it on GitHub https://github.com/dji-sdk/RoboMaster-SDK/issues/58, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO22HYSWILJ2XXM52FLBWTUSOMO3ANCNFSM5KVSIFKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

WinRobotics commented 2 years ago

Might have been a typo, but your last command is missing a semicolon (;) at the end. On Thu, Dec 23, 2021 at 2:06 PM Sherwin Fun @.> wrote: Hi, I am facing some issues with using the UART to manually send serial commands into the Robomaster EP. I am facing this issue when: [input] command; [output] ok; [input] chassis move x 0.1 y 0.0 z 0.0; ------------------------------ robot moves 0.1m [input] chassis move x 0.1 y 0.0 z 0.0 [again] [output] command formart error; command parse error i have checked the documentations inside the SDK but nothing was mentioned. Wondering if there is a need to send back a "ACK/OK" kind of message back to the robomaster ? or is there some timing conditions need to be fulfilled — Reply to this email directly, view it on GitHub <#58>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO22HYSWILJ2XXM52FLBWTUSOMO3ANCNFSM5KVSIFKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.>

Hi Brunoga,

It's my bad that i made a typo mistake in the post. But there wasn't any typo in the actual one

WinRobotics commented 2 years ago

Hi,

Just an update, i realized that when i was doing testing. i placed the robomaster on a wooden block for it wheels to be free rolling for me to run my codes. I realized that this cause the robomaster to go haywire and when i placed it on the floor it was working quite fine abelit some timing issue when inputting in "chassis drive " command.

I think this has to do with the robomaster taking in the in bulit imu for some closed loop feedback controls. Thus, not getting the correct acceleration causes it to go haywire.

I realized that when i am testing, while using chassis speed mode. Even giving it x 0 y 0 z 0 speed. it will still try move a bit. Not sure why. Will do more testing and further update.

WinRobotics commented 2 years ago

Managed to solve the issue, realized that the robomaster imu might be drifting. Thus, when even a zero speed command is issued. The robot still rotates slightly. I have played with the Z value by giving a initial 1.15 to compensate for the drift.

Hope this will help anyone working on the robomaster uart 3rd party software