Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sensors] Added an 'encoders' level to the velocity sensor #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

severin-lemaignan
Copy link
Contributor

This new abstraction level for the velocity sensor that returns encoder ticks instead of linear/angluar speeds

It assumes a differential drive robot as accordingly adds properties to setup wheel radius, wheel base (and encoder resolution).

The current behaviour (linear + angluar speed) is now the (default) 'standard' level.

This pull-request is not ready for merge. I would like first to get feedback on:

  • general usefulness (beyond my own needs :-) )
  • is it a good idea to have it as an abstraction level of the velocity sensor? (maybe not, but it fundamentally returns the same information as linear/angular velocities, at a lower level of abstraction...)
  • I'm a bit lost between local and world velocities, and I'm not sure I got it correctly (let say, I'm pretty sure I didn't...)

@adegroote
Copy link
Contributor

I'm not sure to see the relation of velocity, for me, it looks like really low-level odometry sensor.

add_propery() lines are too long. wheel_base and wheel_radius should probably be robot property, not sensor property. It may be nice also to be able to extend to caterpillars

@adegroote
Copy link
Contributor

Also, it would be nice to be able to test at builder time that the sensor is configured properly for an 'differential robot', not a 'standard one'.

This new abstraction level, that assumes a differential drive robot,
returns encoder ticks instead of displacement
@severin-lemaignan
Copy link
Contributor Author

@adegroote Indeed, Odometry is a better place (I started there, then I switched to Velocity... I do not remember why...). Updated accordingly the PR.
While here, added a unit-test (do not pass on my computer :-( precision issue? rounding error? feedback welcome).

add_property lines wrapped.

For the wheel_radius and wheel_base, I agree that those should be managed at the robot level. This would likely require first the creation of the DifferentialDriveRobot parent class. I can create a separate issue for this if you wish.

@adegroote
Copy link
Contributor

The comment speaks about dtheta, while the code use dw, it is a bit confusing.

Considering the unit-test, I think there is several issues. The precision is probably not really good per se, as you basically add a lots of small float. On the other side, the unit-test use a fixed DELTA, while the error definitively increase at each "step". If you want to keep a fixed DELTA, you should probably store last_{left, right}_encoder and compare with them.

Concerning DifferentialDriveRobot, PhysicalWheelRobot contains most of the needed logic (if not all).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants