ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RPi Pico diff drive, what motor data to HW interface?

asked 2023-08-04 07:39:19 -0500

Ross Botman gravatar image

updated 2023-08-04 08:46:42 -0500

I'm currently attempting to write a complete "library" for the RPi Pico, running Micro-ROS, for controlling a differential drive robot.

I'm copying and taking inspiration from these existing Arduino/ RPi projects:

Arduino ROS bridge

ROS2 Control hardware interface

Basically, the first project is a motor driver/ PID controller, running on an Arduino. The second is running on an RPI, communicating via ROSserial (?). The hardware interface on the Pi requests encoder counts from the Arduino, thereby computing wheel velocity and position, before sending that data to ROS2 Control. In return, the hardware interface transmits motor speed commands to the motor driver on the Arduino. At least that is my naive/ oversimplified understanding.

For my Pico implementation, I would prefer to do all relevant computation on the Pico. I see no problem in computing wheel velocity and positions, and send them to the hardware interface via a custom ROS2 topic/ message, or perhaps a service if that is more suitable.

However, I don't know if there is a "convention", or expectation, that the hardware interface should receive encoder data only.

What would you do?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-08-05 14:54:32 -0500

Ross Botman gravatar image

updated 2023-08-05 14:56:41 -0500

I will follow the excellent recipe given by Josh Newans:

https://www.youtube.com/watch?v=J02jE...

Basically the Pi/ HW Interface will get the total encoder counts since Pico bootup. Compute position in radians, and velocity in radians/ second. Store values in Wheel instances.

I will use a ROS2 service for communication, instead of the read_encoders() function that Newans use in his Arduino serial communication. Service server on the Pico, client on the Pi.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-08-04 05:32:55 -0500

Seen: 208 times

Last updated: Aug 05 '23