cob_lookat_target_publisher.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 import rospy
20 import tf
21 
22 if __name__ == '__main__':
23  rospy.init_node("lookat_target_publisher")
25  rate = rospy.Rate(10.0)
26  pose = (random.uniform(0.2, 1.5), random.uniform(-1.0, 1.0), 1.4+random.uniform(-0.5, 0.5))
27  while not rospy.is_shutdown():
28  br.sendTransform( pose,
29  (0.0, 0.0, 0.0, 1.0),
30  rospy.Time.now(),
31  "lookat_target",
32  "base_link")
33 
34  try:
35  rate.sleep()
36  except rospy.ROSTimeMovedBackwardsException as e:
37  rospy.logwarn("ROSTimeMovedBackwardsException during sleep(). Continue anyway...")
38  except rospy.exceptions.ROSInterruptException as e:
39  pass


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