cob_lookat_action_client.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 random
19 
20 import rospy
21 import actionlib
22 
23 import cob_lookat_action.msg
24 
26  client = actionlib.SimpleActionClient('lookat_action', cob_lookat_action.msg.LookAtAction)
27  print("Waiting for Server...")
28  client.wait_for_server()
29  print("...done!")
30 
31  # Creates a goal to send to the action server.
32  goal = cob_lookat_action.msg.LookAtGoal()
33  goal.target_frame = "lookat_target"
34  goal.pointing_frame = "sensorring_base_link"
35  goal.pointing_axis_type = 0 # X_POSITIVE
36  #print "GOAL: ", goal
37 
38  # Sends the goal to the action server.
39  client.send_goal(goal)
40 
41  # Waits for the server to finish performing the action.
42  client.wait_for_result()
43 
44  result = client.get_result()
45  print(result)
46 
47  return result.success
48 
49 if __name__ == '__main__':
50  try:
51  rospy.init_node('cob_lookat_action_client')
53  except rospy.ROSInterruptException:
54  print("program interrupted before completion")


cob_lookat_action
Author(s): Felix Messmer
autogenerated on Sun Dec 6 2020 03:25:48