1

For example: I've sent DIRECT_COMMAND_REPLY to rotate the motor for 720 deg. When EV3 brick should send reply:

  1. before motor finished rotation (right after my command was received) or
  2. after motor finished rotation?

Now, I have feeling that reply is sent right after my command was received by EV3 brick.

1

I have the same observation as you, it seems to be sent as soon as the brick receives the command.

A workaround that I have found is to send a "stop motor" command after every movement, this way you know when the motor is stopped for sure.

Out of curiosity, what library are you using?

EDIT:

Have you been capturing the packets that the EV3 sends back to the computer?

  • I'm trying to write my own framework in Objective-C: 1) WiFi for iOS based on GCDAsyncSocket and GCDAsyncUdpSocket 2) Bluetooth for OS X based on IOBluetooth. For better understanding this helped me a lot: stackoverflow.com/questions/24253509/…. I'm using Lego Mindstorms EV3 Home Edition Software with EV3 brick connected via Bluetooth and PacketLogger for capturing sended/received commands. – user4053 Aug 7 '15 at 10:42
0

The DIRECT_REPLY is sent when all of the operations in the DIRECT_COMMAND are completed. (Side note: you can have more than one operation in a direct command).

So the better question might be "when does the motor rotation operation complete?". It completes immediately and moves to the next operation in the direct command. This is why you get a reply before the motor movement is completed.

You could try appending opOUTPUT_READY to your direct command to see if it will delay the reply.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.