From: "Alexis Ballier" <aballier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ros/gazebo_ros_control/, dev-ros/gazebo_ros_control/files/
Date: Thu, 28 Jan 2016 20:25:52 +0000 (UTC) [thread overview]
Message-ID: <1454012743.8e1c93101a3d9f946c1278da7e69da3eaa7bf139.aballier@gentoo> (raw)
commit: 8e1c93101a3d9f946c1278da7e69da3eaa7bf139
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 28 20:23:08 2016 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 20:25:43 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e1c9310
dev-ros/gazebo_ros_control: fix build with gazebo7
Package-Manager: portage-2.2.27
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
dev-ros/gazebo_ros_control/files/gazebo7.patch | 61 ++++++++++++++++++++++
.../gazebo_ros_control-2.5.1.ebuild | 1 +
2 files changed, 62 insertions(+)
diff --git a/dev-ros/gazebo_ros_control/files/gazebo7.patch b/dev-ros/gazebo_ros_control/files/gazebo7.patch
new file mode 100644
index 0000000..190756d
--- /dev/null
+++ b/dev-ros/gazebo_ros_control/files/gazebo7.patch
@@ -0,0 +1,61 @@
+commit b5303e692bb5dd2e4f4fc7932c7ec2c7e0b2e907
+Author: Steven Peters <scpeters@osrfoundation.org>
+Date: Tue Apr 14 18:10:36 2015 -0700
+
+ Use Joint::SetParam for joint velocity motors
+
+ Before gazebo5, Joint::SetVelocity and SetMaxForce
+ were used to set joint velocity motors.
+ The API has changed in gazebo5, to use Joint::SetParam
+ instead.
+ The functionality is still available through the SetParam API.
+
+ cherry-picked from indigo-devel
+
+ Add ifdefs to fix build with gazebo2
+
+ It was broken by #315.
+ Fixes #321.
+
+diff --git a/gazebo_ros_control/src/default_robot_hw_sim.cpp b/gazebo_ros_control/src/default_robot_hw_sim.cpp
+index 249c8d3..1d9418d 100644
+--- a/gazebo_ros_control/src/default_robot_hw_sim.cpp
++++ b/gazebo_ros_control/src/default_robot_hw_sim.cpp
+@@ -199,7 +199,7 @@ bool DefaultRobotHWSim::initSim(
+ if (joint_control_methods_[j] != EFFORT)
+ {
+ // Initialize the PID controller. If no PID gain values are found, use joint->SetAngle() or
+- // joint->SetVelocity() to control the joint.
++ // joint->SetParam("vel") to control the joint.
+ const ros::NodeHandle nh(model_nh, "/gazebo_ros_control/pid_gains/" +
+ joint_names_[j]);
+ if (pid_controllers_[j].init(nh, true))
+@@ -216,10 +216,14 @@ bool DefaultRobotHWSim::initSim(
+ }
+ else
+ {
+- // joint->SetMaxForce() must be called if joint->SetAngle() or joint->SetVelocity() are
+- // going to be called. joint->SetMaxForce() must *not* be called if joint->SetForce() is
++ // joint->SetParam("fmax") must be called if joint->SetAngle() or joint->SetParam("vel") are
++ // going to be called. joint->SetParam("fmax") must *not* be called if joint->SetForce() is
+ // going to be called.
++#if GAZEBO_MAJOR_VERSION > 2
++ joint->SetParam("fmax", 0, joint_effort_limits_[j]);
++#else
+ joint->SetMaxForce(0, joint_effort_limits_[j]);
++#endif
+ }
+ }
+ }
+@@ -327,7 +331,11 @@ void DefaultRobotHWSim::writeSim(ros::Time time, ros::Duration period)
+ break;
+
+ case VELOCITY:
++#if GAZEBO_MAJOR_VERSION > 2
++ sim_joints_[j]->SetParam("vel", 0, e_stop_active_ ? 0 : joint_velocity_command_[j]);
++#else
+ sim_joints_[j]->SetVelocity(0, e_stop_active_ ? 0 : joint_velocity_command_[j]);
++#endif
+ break;
+
+ case VELOCITY_PID:
diff --git a/dev-ros/gazebo_ros_control/gazebo_ros_control-2.5.1.ebuild b/dev-ros/gazebo_ros_control/gazebo_ros_control-2.5.1.ebuild
index a8ee997..65b2ca7 100644
--- a/dev-ros/gazebo_ros_control/gazebo_ros_control-2.5.1.ebuild
+++ b/dev-ros/gazebo_ros_control/gazebo_ros_control-2.5.1.ebuild
@@ -27,3 +27,4 @@ RDEPEND="
sci-electronics/gazebo
"
DEPEND="${RDEPEND}"
+PATCHES=( "${FILESDIR}/gazebo7.patch" )
next reply other threads:[~2016-01-29 0:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 20:25 Alexis Ballier [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-07-26 9:24 [gentoo-commits] repo/gentoo:master commit in: dev-ros/gazebo_ros_control/, dev-ros/gazebo_ros_control/files/ Alexis Ballier
2016-07-26 9:24 Alexis Ballier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454012743.8e1c93101a3d9f946c1278da7e69da3eaa7bf139.aballier@gentoo \
--to=aballier@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox