jdrew1303 / ros_duckie

An educational self driving car with ROS based on the Duckiebot
1 stars 0 forks source link

fixing motor pulse from angle encoding issue #1

Closed jdrew1303 closed 5 years ago

jdrew1303 commented 5 years ago

Current differential drive node isn't processing angles passed to it properly. When run on the duckiebot it's going straight ahead even through the suggested angles are changing.

The code is similar to the wrapper found here https://github.com/duckietown/gym-duckietown/blob/master/gym_duckietown/wrappers.py#L32

Our implementation can be found here https://github.com/jdrew1303/ros_duckie/blob/master/src/differential/src/differential_drive_node

Note: what we get from our steering suggestions is encoded as follows: straight ahead is 90 degrees, left is 0 and right is 180 (you can guess the in between values)

jdrew1303 commented 5 years ago

The core of the issue was caused by python craziness when it comes to / in 2.5. It rounds values to an int. So if you are using a float all decimal places are rounded. This is not the case in 3.x