Closed sauk2 closed 3 months ago
A little tangent but somewhat related. Is it possible with the current plugin to be able to drive the vehicle using steering angle and forward velocity?
If not, is it something that can be implemented within the scope of this plugin?
A little tangent but somewhat related. Is it possible with the current plugin to be able to drive the vehicle using steering angle and forward velocity?
If not, is it something that can be implemented within the scope of this plugin?
Hmmmm, I think that's more the role of JointController, Here's how I use them in a model together: https://github.com/CogniPilot/b3rb_simulator/blob/31554eb3126d6ee306a295b2f9f5e8524907b940/b3rb_gz_resource/models/b3rb/model.sdf#L540-L562
Note that JointController uses the velocity rad/s field when using actuator_msg and steering_only in Ackermann with actuator_msg uses the position (rad).
@bperseghetti, on a completely unrelated note. Would it be a good idea to calculate wheel separation in case it is not provided by the user?
We can use the world pose of the left and right steering joints and calculate that value. This calculation will not be performed if there is a value given in the SDF.
Would like to hear your thoughts on this
Attention: Patch coverage is 77.27273%
with 10 lines
in your changes are missing coverage. Please review.
Project coverage is 65.98%. Comparing base (
633ce72
) to head (929a15b
). Report is 5 commits behind head on gz-sim8.
Files | Patch % | Lines |
---|---|---|
...rc/systems/ackermann_steering/AckermannSteering.cc | 77.27% | 10 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@bperseghetti, on a completely unrelated note. Would it be a good idea to calculate wheel separation in case it is not provided by the user?
We can use the world pose of the left and right steering joints and calculate that value. This calculation will not be performed if there is a value given in the SDF.
Would like to hear your thoughts on this
Hmmmm, I think that might be risky depending on the intended use case for it. IE using 4 wheel steering (like you see on a good amount of newer electric trucks). I think maybe you could calculate it though and then see if it does not match the provided value within a "reasonable error percentage" (IE 15%) that it publishes a gz-warn to let you know what value it thinks it should be.
But depending on things like suspension etc the steering joint might actually be a relative reference to another joint and then that would be somewhat messy to follow that potential dependency tree.
IE having joints for a suspension such as macpherson, wishbone, etc would make the steering joint a relative joint to those other suspension joints and that just starts to possibly become more risk than reward.
Therefore, my personal take on it might lean toward it "probably not being a good choice"?
@sauk2 if you merge this it should fix the code coverage issue and cleanly separate the PID steering_only SDF elements: https://github.com/sauk2/gz-sim/pull/1
Hmmmm, I think that might be risky depending on the intended use case for it. IE using 4 wheel steering (like you see on a good amount of newer electric trucks). I think maybe you could calculate it though and then see if it does not match the provided value within a "reasonable error percentage" (IE 15%) that it publishes a gz-warn to let you know what value it thinks it should be.
But depending on things like suspension etc the steering joint might actually be a relative reference to another joint and then that would be somewhat messy to follow that potential dependency tree.
IE having joints for a suspension such as macpherson, wishbone, etc would make the steering joint a relative joint to those other suspension joints and that just starts to possibly become more risk than reward.
Therefore, my personal take on it might lean toward it "probably not being a good choice"?
Yes, that makes sense. Thanks!
A little tangent but somewhat related. Is it possible with the current plugin to be able to drive the vehicle using steering angle and forward velocity?
If not, is it something that can be implemented within the scope of this plugin?
Yes, for that you just set wheel velocity with rad/s using the JointController plugin and also the steering angle all using the actuator msg, example is here:
@bperseghetti Created a seperate PR #2342 for the steering error fix! Request you to take a look.
π¦ Bug fix
Fixes #2314
Summary
Issue pertains to Ackermann Steering plugin's
steering_only
mode specifically these lines.Steps to reproduce
Additionally comment out chassis visual for better visibility
Solution
Changing signs in these equations should suffice.
Check output after implementation![Screenshot from 2024-02-15 14-51-32](https://github.com/gazebosim/gz-sim/assets/75178156/0902218f-b313-4b64-a79d-2b4589e61f8d)
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.πΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈπΈ
π New feature
Summary
gz::math::PID
) to control the steering joints for both modes - velocity and steering only.Configure
which can be overwritten from the SDF using appropriate tags.Test it
For steering only mode
For velocity mode
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.