pose_stamped_publisher.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2
3 import rospy
4 import sys
5 from geometry_msgs.msg import PoseStamped
6 from tf.transformations import quaternion_from_euler
7
8 def usage():
9  "print usage"
10  print "Usage: pose_stamped_publisher.py x y z roll pitch yaw from_frame rate"
11
12 def eulerToQuaternion(roll, pitch, yaw):
13  "convert roll-pitch-yaw to quaternion"
14  return quaternion_from_euler(roll, pitch, yaw)
15
16 if __name__ == "__main__":
17  rospy.init_node("pose_stamped_publisher")
18  argv = rospy.myargv()
19  if len(argv) != 9:
20  usage()
21  sys.exit(1)
22  x = float(argv)
23  y = float(argv)
24  z = float(argv)
25  roll = float(argv)
26  pitch = float(argv)
27  yaw = float(argv)
28  frame = argv
29  rate = float(argv)
30  pose = PoseStamped()
31
33  pose.pose.position.x = x
34  pose.pose.position.y = y
35  pose.pose.position.z = z
36  # roll, pitch, yaw to quaternion
37  q = eulerToQuaternion(roll, pitch, yaw)
38  pose.pose.orientation.x = q
39  pose.pose.orientation.y = q
40  pose.pose.orientation.x = q
41  pose.pose.orientation.w = q
42  r = rospy.Rate(rate)
43  pub = rospy.Publisher("~output", PoseStamped)
44  while not rospy.is_shutdown():
{"ft_lang_label":"__label__en","ft_lang_prob":0.5549184,"math_prob":0.9425861,"size":763,"snap":"2022-05-2022-21","text_gpt3_token_len":202,"char_repetition_ratio":0.17259552,"word_repetition_ratio":0.0,"special_character_ratio":0.30668414,"punctuation_ratio":0.25465837,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96093017,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-18T14:10:32Z\",\"WARC-Record-ID\":\"<urn:uuid:74317ced-eb95-42a3-a0fa-20ba0a310443>\",\"Content-Length\":\"12254\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:51929538-eca8-47bb-93e6-a2471fafe83d>\",\"WARC-Concurrent-To\":\"<urn:uuid:268eea5f-85ec-4cbc-827c-faf63013171d>\",\"WARC-IP-Address\":\"140.211.9.98\",\"WARC-Target-URI\":\"http://docs.ros.org/en/kinetic/api/jsk_topic_tools/html/pose__stamped__publisher_8py_source.html\",\"WARC-Payload-Digest\":\"sha1:JR3N7NL7DLXDWXS3KTPXMGLCR5GRCKKO\",\"WARC-Block-Digest\":\"sha1:X7IX4KNHBF4VWWW3DZ5RTHTE74XCGEMB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320300849.28_warc_CC-MAIN-20220118122602-20220118152602-00547.warc.gz\"}"}