test_move_lin.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 
18 import rospy
19 import actionlib
20 
21 from cob_cartesian_controller.msg import CartesianControllerAction, CartesianControllerGoal
22 from cob_cartesian_controller.msg import Profile
23 
24 if __name__ == '__main__':
25  rospy.init_node('test_move_lin')
26  action_name = rospy.get_namespace()+'cartesian_trajectory_action'
27  client = actionlib.SimpleActionClient(action_name, CartesianControllerAction)
28  rospy.logwarn("Waiting for ActionServer: %s", action_name)
29  client.wait_for_server()
30  rospy.logwarn("...done")
31 
32  # Fill in the goal here
33  goal = CartesianControllerGoal()
34 
35  goal.move_type = CartesianControllerGoal.LIN
36  goal.move_lin.pose_goal.position.x = -0.9
37  goal.move_lin.pose_goal.position.y = 0.0
38  goal.move_lin.pose_goal.position.z = 0.0
39  goal.move_lin.pose_goal.orientation.x = 0.0
40  goal.move_lin.pose_goal.orientation.y = 0.0
41  goal.move_lin.pose_goal.orientation.z = 0.0
42  goal.move_lin.pose_goal.orientation.w = 1.0
43  goal.move_lin.frame_id = 'world'
44 
45  goal.profile.vel = 0.2
46  goal.profile.accl = 0.1
47  goal.profile.profile_type = Profile.SINOID
48 
49  #print goal
50 
51  # Send the goal
52  client.send_goal(goal)
53  client.wait_for_result()


cob_cartesian_controller
Author(s): Christoph Mark
autogenerated on Thu Apr 8 2021 02:40:13