Hi,
I just follow the excellent ros_control tutorial at (http://gazebosim.org/tutorials/?tut=ros_control) and able to run robot in gazebo, that provide command interface for each joint
roslaunch rrbot_gazebo rrbot_world.launch
roslaunch rrbot_control rrbot_control.launch
Next, I'd like to control this robot from our application, so need to use JointTrajectoryAction (or FollowJointTrajectoryAction), so I added following code in rrbot_control
diff --git a/rrbot_control/config/rrbot_control.yaml b/rrbot_control/config/rrbot_control.yaml
index 9cbcf45..0f62b1a 100644
--- a/rrbot_control/config/rrbot_control.yaml
+++ b/rrbot_control/config/rrbot_control.yaml
@@ -13,3 +13,15 @@ rrbot:
type: effort_controllers/JointPositionController
joint: joint2
pid: {p: 100.0, i: 0.01, d: 10.0}
+
+ # Trajectory Controllers ---------------------------------------
+ joint_trajectory_controller:
+ type: "effort_controllers/JointTrajectoryController"
+ joints:
+ - joint1
+ - joint2
+
+ gains: # Required because we're controlling an effort interface
+ joint1: {p: 100, d: 1, i: 1, i_clamp: 1}
+ joint2: {p: 100, d: 1, i: 1, i_clamp: 1}
+
diff --git a/rrbot_control/launch/rrbot_control.launch b/rrbot_control/launch/rrbot_control.launch
index 0a0c605..a4b1b2a 100644
--- a/rrbot_control/launch/rrbot_control.launch
+++ b/rrbot_control/launch/rrbot_control.launch
@@ -7,7 +7,9 @@
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" ns="/rrbot" args="joint_state_controller
joint1_position_controller
- joint2_position_controller"/>
+ joint2_position_controller
+ joint_trajectory_controller
+ "/>
<!-- convert joint states to TF transforms for rviz, etc -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
but I got have following error. Is it possible to run joint trajectory action while keeping ability to command value to each joint? I remember some real robto (pr2, baxter) has capable of this, so how do the archive that?
[ERROR] [WallTime: 1421039041.629407] [242.570000] Failed to start controllers: joint_state_controller, joint1_position_controller, joint2_position_controller, joint_trajectory_controller
[ WARN] [1421039041.629194844, 242.570000000]: Resource conflict on [joint1]. Controllers = [joint1_position_controller, joint_trajectory_controller, ]
[ WARN] [1421039041.629234042, 242.570000000]: Resource conflict on [joint2]. Controllers = [joint2_position_controller, joint_trajectory_controller, ]
[ERROR] [1421039041.629256800, 242.570000000]: Could not switch controllers, due to resource conflict
Originally posted by Kei Okada on ROS Answers with karma: 1186 on 2015-01-12
Post score: 2