Advertisement
Guest User

meka_action_server.py

a guest
Oct 10th, 2013
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import roslib; roslib.load_manifest('meka_moveit_action_server')
  3. import time, sys, threading, math
  4. import copy
  5. import datetime
  6. import socket, select
  7. import struct
  8. import traceback, code
  9. import optparse
  10. import SocketServer
  11. from BeautifulSoup import BeautifulSoup
  12.  
  13. import rospy
  14. import actionlib
  15. from sensor_msgs.msg import JointState
  16. from control_msgs.msg import FollowJointTrajectoryAction
  17. from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
  18.  
  19. class MekaTrajectoryFollower:
  20.     def __init__(self):
  21.         self.server = actionlib.SimpleActionServer("follow_joint_trajectory", FollowJointTrajectoryAction, self.execute, auto_start=False)
  22.  
  23.     def execute(self, goal):
  24.         print "I am executing and I got the goal:", goal
  25.         self.server.set_succeeded()
  26.  
  27.     def start(self):
  28.         self.server.start()
  29.         print "The action server for this driver has been started"
  30.  
  31. def main():
  32.     rospy.init_node('meka_action_server')
  33.     action_server = MekaTrajectoryFollower()
  34.     action_server.start()
  35.     rospy.spin()
  36.  
  37. if __name__ == '__main__':
  38.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement