Converting Joystick to Velocity

Hi,

I have a robot which is connected to ROS and takes linear velocity (x,y) and angular velocity (theta) as inputs from PC for driving it around. On the other hand, I want a joystick to connect to an Arduino irrespective of ROS connection.

The question is, how do I convert this joystick values (-255 to 255 after mapping) to (x,y) and (theta). This makes the entire code friendly for both the systems. I understand that ROS gives velocity while joystick gives analog values, but just checking if there is a way for this. Maybe trignometry, maths... or anything else?

What are the Theta values that are currently being used? What units are they in?

Theta values are in the range of -1 to 1 while x and y are between -0.5 to 0.5. I am using the teleop keyboard node in ros and this is the output from the default node.

To be of any use, you need to know what those values represent. Is it inches, is it cm or mm or degrees or radians or?

ROS uses SI units. Angular rate the default is radians/second and linear velocity is meters/second.

So, these values are telling you how fast to turn, not how far to turn?

Yes. How much to turn in a second. I dont need exact same as in ROS. I dont even need those units. What i need is the joystick should give me values in velocity style. To extend what I am doing, I have another function for kinematics to which angular and linear velocities are fed which outputs pwm required for four motors. I just want the joystick also to be pushed in between so that kinematics takes the values from joystick.

Any help plz?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.