0
$\begingroup$

How can a motor control node (which will subscribe to the cmd_vel topic) be linked to my robot hardware?

My first idea is to communicate via byte signal like

|0000|0000|0000|0000|0000|

as

|ID|Motor_1|Motor_2|Motor_3|Motor_4|

Arduino will be used as the low level hardware control, and receive the signal and information via byte using a nrf240L1 module. Would this work?

$\endgroup$

1 Answer 1

1
$\begingroup$

You can use rosserial for sending commands over the Serial port to your Arduino.

|0000|0000|0000|0000|0000| as |ID|Motor_1|Motor_2|Motor_3|Motor_4|

This is called a dataframe. If you do end up using Serial transports, you would have to design your own dataframe. What you have should work, but do keep in mind your requirements. If the arduino is responsible for sending over some information about each motor encoder, you should adapt your dataframe to include this information as well. Also, you should think about using some start and end flags (could be a sequence or a particular number) that will help you to know when a new transmission has arrived, and when the current transmission has ended.

EDIT: I looked at the nRF240L1 module you were talking about, and turns out it uses an SPI-based communication interface. In this case, your arduino would act as a bridge, which takes in data passed in via Serial , and sends the appropriate SPI commands over to the particular transceiver.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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