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?
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.
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.