ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Differential drive encoder interpretation

asked 2016-09-20 20:57:03 -0600

Cerin gravatar image

I'm trying to use the differential_drive package to convert my encoder counts to odometry messages, but the docs are a little ambiguous.

My encoders are non-quadrature, so I can either provide an absolute pulse count, which will only increment, or take into account the active motor speed and provide a relative count, which may increment or decrement depending on motor direction. However, the package's docs just say:

The hardware is expected to count pulses from the wheel encoders, and provide the total number of pulses since the start of tracking.

Does this mean it expects an absolute pulse count or a relative pulse count? The phrasing makes me think the former, but since the package calculates odometry, I don't see how it could do that without knowing the direction that the pulses imply.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2016-09-21 02:00:34 -0600

Mark Rose gravatar image

I've used the differential_drive package as you suggest. It wants absolute counts reported by the robot controller, not relative. I assume you're planning to run your motors only forward. I've successfully used non-quadrature encoding while running the motors both directions, but it requires coasting to a stop, waiting, updating some state variable, then reversing direction. The total encoder count can be incremented or decremented, depending on the direction state variable.

However, I've never tried to do bidirectional movement without quadrature encoding while using ROS. If you use the ROS navigation stack, you necessarily relinquish some low-level control of the motors to gain the benefit of the global and local planners. Both the planners assume the motors can move either direction.

edit flag offensive delete link more

Comments

Why do you say I'll only run my motors forwards? I plan on going both forwards and backwards. I think I've miscommunicated. By "absolute count" I mean the count never decrements. It literally counts encoder pulses, which can never decrement since there's no such thing as a "negative" encoder pulse.

Cerin gravatar image Cerin  ( 2016-09-21 08:52:51 -0600 )edit

My question is about what kind of count the differential_drive package expects. If I reverse my motors, does differential_drive expect the encoder count to decrement?

Cerin gravatar image Cerin  ( 2016-09-21 08:53:43 -0600 )edit

Yes. As I said, differential_drive expects an absolute encoder count, incrementing when driving forward, decrementing when driving backward. I assumed you would only drive forward because of the problems inherent in a single-tick encoder. You can drive both directions, but it's tricky.

Mark Rose gravatar image Mark Rose  ( 2016-09-21 09:41:33 -0600 )edit

You will probably have to write your own local planner if you want to use the navigation stack, because the default local planners assume that the odometry will work properly even when reversing motor direction. A single-tick setup might might lose counts because of inertia in the system.

Mark Rose gravatar image Mark Rose  ( 2016-09-21 09:43:29 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2016-09-20 20:57:03 -0600

Seen: 1,276 times

Last updated: Sep 21 '16