-
Notifications
You must be signed in to change notification settings - Fork 277
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
Question regarding mecanum drive plugin & feature request #2261
Comments
@mjcarroll I was wondering if you maybe know more about this? |
@scpeters any thoughts? |
Screencast.from.15.12.2023.15.04.14.webmAny updates? I am really confused on how this plugin works, I even swapped the spheres for cylinders and it works. But I see no forces applied to any body? Just pure wheel speeds. |
It works using the same principle as tracked vehicles (see https://arxiv.org/pdf/1703.04316.pdf) where the desired velocity is part of the constraints on a contact point, in addition to normal force and friction. The constraint solver is asked to satisfy this desired velocity so it will apply the necessary force on the wheels. This is a much more efficient way of modelling tracked vehicles and mecanum wheels than simulating the individual wheels. At least for tracked vehicles, we've tried in the past to simulate individual wheels, and while it works, the performance drops due to the sheer number of contacts to process. |
@azeey, thank you for your recent clarifications! They were really helpful. Could you please guide me to where I can find these equations in our codebase? I'd like to take a closer look. Additionally, I wanted to come back to the feature I proposed earlier. Would you consider this feature beneficial and something you would consider merging if I implemented it? I am trying to implement a mecanum rover in PX4, but I want the controller to output the wheel speeds, that's why I would like to control the wheels directly, instead of the linear- and yaw velocity. |
Any updates on this? @azeey sorry for the constant tagging, I just really need this done for a project. |
If you want to control the velocities of each joint, we already have the |
Ah, so the mecanum force logic, is already built into gazebo. So if I simulate a rover and use 4 JointControllers, and use my custom mecanum inverse kinematics to control the 4 individual motors, the rover will behave like a mencaum rover even if I don't have the mecanum plugin in the sdf? |
No, I thought you meant you'd model the wheels of a mecanum wheel. So are you asking about extending the Mecanum plugin so it accepts joint velocities as an alternative to cmd_vel, but still uses the current velocity constraint based approach to actually move the robot? |
"extending the Mecanum plugin so it accepts joint velocities as an alternative to cmd_vel, but still uses the current velocity constraint based approach to actually move the robot" This is exactly what I mean! Sorry for being unclear. |
In that case, yes, I think we'd welcome a PR. Thanks for your patience. |
Awesome! Thank you for your help :). Do you have any preference on what message type I should use for this? I think if we make something new or use something existing, we should make sure that the message type can get reused in other plugins, like differential drive, or Ackermann too. Or if required, make separate message types. |
Would the |
I would suggest actuators msg as that is already used across most "drive" plugins and eliminates the painful need for super specific joint/entity names otherwise. |
Sorry I'm late to this discussion. Yes, the mecanum force logic is encoded within a given model's friction parameters:
See examples/worlds/mecanum_drive.sdf for an example. I need to write a tutorial to explain how these parameters all work together
yes, this should be the case |
This means you can just link it up from the |
Ohh, awesome! I was quite confused, but now it makes sense! Thank you, but then I don't need to make the PR, I can just use 4 joint controllers and leave away the mecanum plugin. Also, yes a video would be awesome, I think it would help a lot of beginners (like me :D) and save you guys some time. Thank you for the help guys, I really appreciate it! |
Desired behavior
My question is how the current mecanum plugin works, I don't see any force control in the plugin, so I feel like the plugin is actually friction-based simulation? If that is the case, how do you manage it? When looking at the collision model, the wheels are spheres with only one joint. This can be found around 12 seconds into the video.
https://www.youtube.com/watch?v=keGh5wYqTOg
I would like to propose a feature where we can individually manage the angular velocities of each wheel, instead of just controlling the overall linear velocities in the x and y axes and the yaw velocity. This feature would allow us to directly publish commands to a topic that controls each of the four (or more) wheels separately. The primary benefit of this approach is that it enables us to handle the inverse kinematics calculations on our end, rather than relying on the existing plugin to do so.
Implementation suggestion
Add another topic to control all 4 or more wheels independently :)! The topic only needs 4 wheels, but we can map more in the URDF.
The text was updated successfully, but these errors were encountered: