Robotics StackExchange | Archived questions

How to modify ros_arduino_bridge to work with different motor controller?

Hi,

I am using rosarduinobridge to try to control a differential drive robot. I want to use this package on ROS Kinetic on Ubuntu 16.04.1. https://github.com/hbrobotics/ros_arduino_bridge

My programming is still introductory so I just need some help figuring out where I am supposed to modify the code in order use my own custom motor driver, the Sparkfun Mega Moto Shield. All that is noted there is to comment out the #USEBASE but not much after that. I have been searching and found this other question that has somewhat helped. https://answers.ros.org/question/60836/how-exactly-does-rosarduino_bridge-work/

The answer to that question stated he created new functions in the encoderdriver.cpp and motordriver.cpp: readEncoder(), resetEncoder(), resetEncoders(), initMotorController(), setMotorSpeed() and setMotorSpeeds().

Are these the only things that I would need to change in order to get this package working with my Arduino Mega + Monster Moto Shield?

I have a code for my Monster Moto Shield already that can read encoder counts, and another one that drives basic motor movements, all based on my own pin definitions with my Arduino Mega, but they look completely different from how the codes are written in the package given, so it is quite intimidating trying to figure out where to start.

If you have any advice or tips that could direct me to modifying this package, I would greatly appreciate it.

Best,

Matthew.

Asked by geistmate on 2019-02-15 22:17:07 UTC

Comments

Hi, Currently stuck on this.. how did you figure it out? Thanks

Asked by femitof on 2020-04-05 22:11:38 UTC

Answers