reactive_planning_example.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 simple_moveit_interface as smi
20 import six
21 
22 #Requirements:
23 #- latest cob_bringup layer with lookat_component
24 #- sensor input for moveit enabled?
25 #- robot facing a wall in the background
26 #- lookat_action server and monitor started?
27 #- lookat works for both arm positions?
28 #
29 #- These positions currently are cob3-3 specific
30 
31 
32 if __name__ == '__main__':
33  rospy.init_node('move_example')
34 
35  smi.add_ground()
36  rospy.sleep(1.0)
37 
38  #while rospy.get_time() == 0.0: pass
39  rospy.logerr('Are you using cob3-3? Did you make sure all requirements are met? Read the code file!')
40  ans = six.moves.input('[y/n] ')
41  if ans == 'y':
42  while not rospy.is_shutdown():
43  print("Going Left")
44  success = smi.moveit_joint_goal("arm", [0.6132456177400849, -1.2667904686872227, -1.3351177346743512, 0.623757247043325, 2.6443916288424734, 0.2923237627622837, -2.121120037112681], True)
45  #success = smi.moveit_joint_goal("arm", [0.4474927123777702, -1.4042363503909014, -1.3427710033793065, 0.8556133802524375, 2.8670612914249532, 0.2447635934094972, -1.8559613290891581], True)
46  print("Going Right")
47  success = smi.moveit_joint_goal("arm", [-0.4429381361070571, -2.027464518329273, 0.5376498408783335, -0.07512923290336566, -0.5249117648804152, 0.4386535797226253, -0.7085319372561121], True)
48  #success = smi.moveit_joint_goal("arm", [-0.2875421191578158, -1.8672004116184473, 0.5368099709961187, -0.07435202034076506, -0.523647727633693, 0.43781158053874125, -0.709280142446791], True)
49  elif ans == 'n':
50  rospy.logerr('Please activate it!')
51 
52 


cob_moveit_interface
Author(s): Felix Messmer
autogenerated on Sun Dec 6 2020 03:25:57