Hi to all,
I'm trying to write a ROS node for my mobile robot which is based on a skid-steering system. I have two motors, one per each side, and each motor can be controlled by using A C/C++ function:
int motor_cmd(MOTOR_channel, VALUE);
where motor_channel is used to choose the motor to control and VALUE is an integer with a range (-100, 0, +100). Values 0, +100 make the motor spin forward while 0, -100 make the robot spin backward.
I would like to use a bluetooth joypad and write a teleop node to control the robot. The problem is that I'm not able to figure out how to implement the skid steering motion.
What kind of relation should I write to use the X-Y values which come from the joypad as parameter for my motor_cmd() function?
I mean, if for example I use the joypad to go forward, then X=0, Y=MAX_VALUE and then the function should be: motor_cmd(1, 100); motor_cmd(2, 100); Or if I turn on the spot and so X = MAX_value, Y = - MAX_value, then: motor_cmd(1, 100); motor_cmd(2, -100);
How can I implement this algorithm? Can you help me, please?
Post score: 1