I am new to ROS2 but I am trying to create an alternative to a hardware interface for my robot.

I have a diff drive vehicle. The main ROS program will run on an Ubuntu PC. The controller on the vehicle is an MyRio from National Instruments. From what I found online and what I tested. I am able to communicate from MyRIO to Labview and after that to ROS through DDS. Can't establish a connection from MyRIO directly to ROS (don't know why). But it works this way so all good.

MyRio does the encoder data acquisition and sends them via a topic to ROS (Encoder1,Encoder2) and also waits a PWM on (M1,M2 topics).

So my question is how can I evade having an hardware interface? How can I process the data provided by nav2 (/diff_cont/cmd_vel_unstamped) to get just a PWM on the 2 motors I have? Also where should I place the encoder data I receive?

I only tested the robot in a gazebo simulation but I have no idea how to advance to control the real robot. Here is the robot repo if it is of any help: https://github.com/Serarguy/amr_platform

Any help is appreciated. Thanks a lot!


1 Answer 1


What do you mean by hardware interface? You mean a hardware component of the ros2_control stack?

From /diff_cont/cmd_vel_unstamped you need to calculate the wheel speeds by solving the kinematics of your robot. This is done by the diff_drive_controller already, but you need a hardware component then. Of course you could copy that in a custom node and leave the ros2_control stack, but then you can't just simply switch between simulation and hardware without changing your controller.


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.