5 from geometry_msgs.msg
import PointStamped, TransformStamped
15 rospy.set_param(
"kalman/initialX", transform.transform.translation.x)
16 rospy.set_param(
"kalman/initialY", transform.transform.translation.y)
17 rospy.set_param(
"kalman/initialZ", transform.transform.translation.z)
18 update_params([
"kalman/initialX",
"kalman/initialY",
"kalman/initialZ"])
20 rospy.set_param(
"kalman/resetEstimation", 1)
23 firstTransform =
False 25 msg.header.frame_id = transform.header.frame_id
26 msg.header.stamp = transform.header.stamp
28 msg.point.x = transform.transform.translation.x
29 msg.point.y = transform.transform.translation.y
30 msg.point.z = transform.transform.translation.z
34 if __name__ ==
'__main__':
35 rospy.init_node(
'publish_external_position_vicon', anonymous=
True)
36 topic = rospy.get_param(
"~topic",
"/vicon/cf/cf")
38 rospy.wait_for_service(
'update_params')
39 rospy.loginfo(
"found update_params service")
40 update_params = rospy.ServiceProxy(
'update_params', UpdateParams)
46 msg.header.stamp = rospy.Time.now()
48 pub = rospy.Publisher(
"external_position", PointStamped, queue_size=1)
49 rospy.Subscriber(topic, TransformStamped, onNewTransform)
def onNewTransform(transform)