-
Notifications
You must be signed in to change notification settings - Fork 67
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
Various bug fixes #114
Various bug fixes #114
Conversation
14d358f
to
6716415
Compare
ign_ros2_control/src/ign_system.cpp
Outdated
@@ -173,8 +175,14 @@ bool IgnitionSystem::initSim( | |||
|
|||
this->dataPtr->joints_.resize(this->dataPtr->n_dof_); | |||
|
|||
constexpr double default_gain = 0.1; | |||
if (!this->nh_->get_parameter_or("position_proportional_gain", this->dataPtr->position_proportional_gain_, default_gain)) |
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.
An optional gain parameter. Previously it was hard-coded to 1.0.
ign_ros2_control/src/ign_system.cpp
Outdated
@@ -532,13 +540,13 @@ IgnitionSystem::perform_command_mode_switch( | |||
this->dataPtr->joints_[j].joint_control_method &= | |||
static_cast<ControlMethod_>(VELOCITY & EFFORT); | |||
} | |||
if (interface_name == (this->dataPtr->joints_[j].name + "/" + | |||
else if (interface_name == (this->dataPtr->joints_[j].name + "/" + |
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 efficiency improvement
ign_ros2_control/src/ign_system.cpp
Outdated
@@ -627,6 +637,25 @@ hardware_interface::return_type IgnitionSystem::write( | |||
{this->dataPtr->joints_[i].joint_effort_cmd}); | |||
} | |||
} | |||
|
|||
// Fallback case is a velocity command of zero |
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 think this is what prevented the unactuated joints from drooping with gravity.
ign_ros2_control/src/ign_system.cpp
Outdated
@@ -590,14 +599,14 @@ hardware_interface::return_type IgnitionSystem::write( | |||
} | |||
} | |||
|
|||
if (this->dataPtr->joints_[i].joint_control_method & POSITION) { | |||
else if (this->dataPtr->joints_[i].joint_control_method & POSITION) { |
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.
else-if so the velocity command from this interface doesn't conflict with the one at L597
c7bd1e6
to
d0f114f
Compare
d0f114f
to
61d51ce
Compare
ament_cpp_lint conflicts with one of the other linters:
|
be428ec
to
c3b4d4e
Compare
@AndyZe do you have any plans to include these fixes in |
I don't mind making a quick PR to I actually wasn't aware of |
We need to support Gazebo classic too, the code is pretty similar, when something is added here or there I try to keep both repositories up to day. If the contributor is open to do it it's fantastic otherwise I will do it. By the way, thank you for your contribution. |
Fixes #113. To quote from that issue:
Here are some of the bugs in that code:
Here's a "before" video. It's hard to see but note that the "upper_arm_link" of the robot is always drooping down with gravity although only the elbow joint is actuated.
slow_droop.online-video-cutter.com.mp4
Here's an "after" video showing no droop of other joints besides the actuated elbow.