-
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
Mecanum wheels demo #683
Mecanum wheels demo #683
Conversation
Initial version copied from diff_drive_skid example. Signed-off-by: Steve Peters <[email protected]>
This modifies the friction parameters of the wheels in the skid-steer example vehicle to behave like Mecanum wheels, with anisotropic friction and friction directions that are constant in the chassis frame. To specify these friction directions, the //fdir1/@Gazebo:expressed_in attribute is used. The friction values are specified as 1.0 in the direction corresponding to the Mecanum wheel roller axes, and 0.0 in the perpendicular direction, which corresponds to the rolling direction. Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
No files changed yet, this is only a file copy. Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
…into mecanum_wheels_demo
Signed-off-by: Steve Peters <[email protected]>
Based on the following references: https://robohub.org/drive-kinematics-skid-steer-and-mecanum-ros-twist-included/ https://research.ijcaonline.org/volume113/number3/pxc3901586.pdf Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
ok, I just got a working joystick configuration with an ign-launch file in scpeters/ign-launch@ad0efb2 on my gamepad, the left analog stick commands longitudinal and lateral velocity, and the horizontal part of the right analog stick is used for turning |
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
I think this is ready for review. It's missing the Odometry, but the controller works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so cool!! Left a few minor comments. If you don't have time to implement the odometry, I'd suggest removing the functionality completely and revisiting later.
} | ||
|
||
// If the joints haven't been identified yet, look for them | ||
static std::set<std::string> warnedModels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why warnedModels
is a set. Can there be more than one model here?
|
||
// constant used in computing target velocities | ||
const double angularLength = 0.5 * (this->wheelSeparation + this->wheelbase); | ||
const double invWheelRadius = 1 / this->wheelRadius; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can wheelRadius
be 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works! Just some smaller comments from @azeey and me.
public: transport::Node node; | ||
|
||
/// \brief Entity of the front left joint | ||
public: std::vector<Entity> frontLeftJoints; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen a vehicle with more than 4 mecanum wheels, is that possible? If not, we probably should just store a single Entity
for each joint.
{ | ||
double minVel = _sdf->Get<double>("min_velocity"); | ||
this->dataPtr->limiterLin->SetMinVelocity(minVel); | ||
this->dataPtr->limiterAng->SetMinVelocity(minVel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize that this is just following the pattern from other systems, but I'm wondering if we should split linear and angular components, considering that they have different units.
|
||
double linVel; | ||
double latVel; | ||
double angVel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggestion, instead of 3 vars, this could use a Commands
object
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
removed in 49eb8cb |
Signed-off-by: Steve Peters <[email protected]>
53c2823
to
bcfb881
Compare
I haven't yet addressed some of the comments related to the code in MecanumDrive. I wasn't very thoughtful in architecting it, I just copied DiffDrive and added to it. I'm not sure I'll have time to address those concerns before code freeze given other higher priority pull requests. Maybe addressing the current set of comments is doable, but I'm sure there are more and more issues to be found here if reviews continue getting stricter and I'd rather focus elsewhere than polishing this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as a first revision! I'll come back to this after the release and address the remaining comments, which should be backwards compatible.
🎉 New feature
Closes #579
Summary
This adds an example world that is based on the diff_drive_skid example but uses a new feature in dartsim exposed by an SDFormat attribute in a custom xml namespace in gazebosim/gz-physics#224. The friction parameters are modified in 48010ca to use a friction direction that is constant in the chassis frame and points at a 45 degree angle from each wheel's revolute joint axis. The friction coefficients are set to 1.0 and 0.0 in the perpendicular directions.
Test it
The vehicle can be operated like a skid-steer vehicle using the diff-drive system that is currently attached. I need to create a new system to enable driving sideways.
To see it move sideways, you can do the following:
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge