Hello, I am fairly new to ROS and have recently gone through beginner tutorials. I'm using ROS kinetic 1.12.2 on Ubuntu 16.04.3 LTS (and kernal name 4.13.0-32-generic).
I am following the tutorial for dynamixel_contollers as posted on [http://wiki.ros.org/dynamixel_controllers/Tutorials](http://wiki.ros.org/dynamixel_controllers/Tutorials). I have 3 dynamixels that I've been using: 2 mx-106 and 1 mx-64. They are daisy chained.
I have been able to make all of the tutorials work, **except** Creating a dynamixel action client controller. In particular, when I execute the python script the tutorial provides, trajectory_client.py, my terminal hangs up "waiting for joint trajectory action" as such:
robert:scripts$ python trajectory_client.py
[INFO] [1520631936.725541]: Waiting for joint trajectory action
I will post all of the relevant code below. Looking at actionlib documentation and the tutorial python code, I see that wait_for_server() must be activated but is not connecting to the action server. I'm not sure why.
Here is my tilt.yaml file:
joint3_controller:
controller:
package: dynamixel_controllers
module: joint_position_controller
type: JointPositionController
joint_name: claw_1f
joint_speed: 1.0
motor:
id: 1
init: 0
min: 0
max: 4095
joint4_controller:
controller:
package: dynamixel_controllers
module: joint_position_controller
type: JointPositionController
joint_name: traction_1f
joint_speed: 1.0
motor:
id: 2
init: 0
min: 0
max: 2047
joint5_controller:
controller:
package: dynamixel_controllers
module: joint_position_controller
type: JointPositionController
joint_name: joint_1f
joint_speed: 1.0
motor:
id: 3
init: 0
min: 0
max: 4095
Here is my start_meta_controller.launch:
Here is my python code
#!/usr/bin/env python
import roslib
roslib.load_manifest('my_dynamixel_tutorial')
import rospy
import actionlib
from std_msgs.msg import Float64
import trajectory_msgs.msg
import control_msgs.msg
from trajectory_msgs.msg import JointTrajectoryPoint
from control_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, FollowJointTrajectoryAction, FollowJointTrajectoryGoal
class Joint:
def __init__(self, motor_name):
#arm_name should be b_arm or f_arm
self.name = motor_name
self.jta = actionlib.SimpleActionClient('/'+self.name+'_controller/follow_joint_trajectory', FollowJointTrajectoryAction)
rospy.loginfo('Waiting for joint trajectory action')
self.jta.wait_for_server()
rospy.loginfo('Found joint trajectory action!')
def move_joint(self, angles):
goal = FollowJointTrajectoryGoal()
char = self.name[0] #either 'f' or 'b'
goal.trajectory.joint_names = ['claw_1f'+char, 'traction_1f'+char,'joint_1f'+char]
point = JointTrajectoryPoint()
point.positions = angles
point.time_from_start = rospy.Duration(3)
goal.trajectory.points.append(point)
self.jta.send_goal_and_wait(goal)
def main():
arm = Joint('f_arm_controller')
arm.move_joint([0.5,1.5,1.0])
arm.move_joint([6.28,3.14,6.28])
if __name__ == '__main__':
rospy.init_node('joint_position_tester')
main()
Here is my joints_trajectory_controller.yaml:
#groups all controllers and makes into action server.
f_arm_controller:
controller:
package: dynamixel_controllers
module: joint_trajectory_action_controller
type: JointTrajectoryActionController
joint_trajectory_action_node:
min_velocity: 0.1
constraints:
goal_time: 0.25
#. The goal_time parameter in the changes only the time period between each action and does not interfere with the motor's velocity.
Lastly, here's my manifest:
my_dynamixel_tutorial 0.0.0 The my_dynamixel_tutorial package robert TODO catkin dynamixel_controllers roscpp rospy std_msgs dynamixel_controllers roscpp rospy std_msgs dynamixel_controllers roscpp rospy std_msgs control_msgs control_msgs control_msgs trajectory_msgs trajectory_msgs trajectory_msgs
↧