4 from trajectory_msgs.msg
import JointTrajectory, JointTrajectoryPoint
5 from control_msgs.msg
import JointTrajectoryControllerState
as JTCS
6 from teleop_tools_msgs.msg
import IncrementAction
as TTIA
18 state = rospy.wait_for_message(
"state", JTCS)
21 self._goal.joint_names = state.joint_names
22 rospy.loginfo(
'Connected to ' + controller_ns)
27 self._as.set_succeeded([])
30 state = rospy.wait_for_message(
"state", JTCS)
31 self.
_value = state.actual.positions
32 self.
_value = [x + y
for x, y
in zip(self.
_value, increment)]
33 rospy.loginfo(
'Sent goal of ' + str(self.
_value))
34 point = JointTrajectoryPoint()
35 point.positions = self.
_value 36 point.time_from_start = rospy.Duration(0.1)
37 self._goal.points = [point]
38 self._command_pub.publish(self.
_goal)
40 if __name__ ==
"__main__":
41 rospy.init_node(
'incrementer_server')
42 controller_namespace =
'spine_controller'
def __init__(self, controller_ns)
def increment_by(self, increment)