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

Track controller with position output #2016

Closed
jrutgeer opened this issue Jun 15, 2023 · 3 comments · Fixed by #2021
Closed

Track controller with position output #2016

jrutgeer opened this issue Jun 15, 2023 · 3 comments · Fixed by #2021
Assignees
Labels
enhancement New feature or request

Comments

@jrutgeer
Copy link
Contributor

jrutgeer commented Jun 15, 2023

I am looking into simulating a conveyor that has an encoder output (i.e. publishes the conveyor belt position).

I assume the track controller system would be the right place to add that functionality.

Is there any interest that this would be added (I can try and submit a PR)?

I am not sure how to implement this though. AFAIK the track controller does not have the notion of position, it just changes friction parameters to simulate motion?

I had a look at the tracked vehicle system, as it outputs odometry data. But it seems this just integrates the velocity commands? This seems strange, since there might as well be slip between the track and the contacting surface. So if you just integrate the commanded velocity, this will eventually lead to incorrect odometry values?

An alternative could be to implement a new system, similar to the Ariac conveyor belt plugin. This does not change the friction, but (if I recall correctly) it models a linear joint between the conveyor and its collision entity. The joint is then moved at the set velocity (so the objects on top of it move with it), and every once in a while the joint position is reset to 0 (in one timestep). But this is in Gazebo classic, not sure if this could be implemented in the same way in Gazebo sim?

@jrutgeer jrutgeer added the enhancement New feature or request label Jun 15, 2023
@jrutgeer
Copy link
Contributor Author

Further thinking of it: in the case of a conveyor, integration of the velocity commands is actually correct, as an ideal conveyor does realize the commanded motion. Obviously objects on the conveyor can slip.

For the tracked vehicle however, I think it would be better to calculate odometry based on the actual pose wrt world.

@azeey
Copy link
Contributor

azeey commented Jun 15, 2023

For the tracked vehicle however, I think it would be better to calculate odometry based on the actual pose wrt world.

If the tracks slip, wouldn't the position of the track still change without the corresponding motion of the vehicle? i.e, slipping would introduce an error even if you use the joint position. Also, odometry is not meant to give you the ground truth. Errors due to slip should be included in the odometry output to simulate real odometry measurements. If you want ground truth, you can just get the pose of the vehicle without using odometry.

@jrutgeer
Copy link
Contributor Author

Errors due to slip should be included in the odometry output to simulate real odometry measurements.

Indeed. My line of thought was similar to e.g. a simulated camera, where a 'perfect' image is rendered and noise is added afterwards. So I similarly assumed 'perfect odometry' onto which an error would be applied afterwards. But in this case calculating the error would come down to estimating slip, which inherently is in behavior of the plugin itself. So it makes sense.

Anyway, the conclusion is that track position can be calculated by integrating the velocity commands.

Remain following questions:

  1. Is it relevant to be added (i.e. do I submit a PR) or do I just implement this locally?
  2. I think ideally the plugin should report track position, velocity, acceleration and jerk. I checked gz-msgs but there doesn't seem to be an existing message proto for this. Is it best to define a new one, or is there some other (combination of?) message(s) to cover this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants