6 from crazyflie_driver.msg
import FullState
11 if __name__ ==
'__main__':
12 parser = argparse.ArgumentParser()
13 parser.add_argument(
"trajectory", type=str, help=
"CSV file containing trajectory")
14 args = parser.parse_args()
16 rospy.init_node(
'full_state')
19 traj.loadcsv(args.trajectory)
21 rate = rospy.Rate(100)
25 msg.header.stamp = rospy.Time.now()
26 msg.header.frame_id =
"/world" 28 pub = rospy.Publisher(
"/crazyflie/cmd_full_state", FullState, queue_size=1)
29 start_time = rospy.Time.now()
31 while not rospy.is_shutdown():
33 msg.header.stamp = rospy.Time.now()
34 t = (msg.header.stamp - start_time).to_sec()
42 msg.pose.position.x = e.pos[0]
43 msg.pose.position.y = e.pos[1]
44 msg.pose.position.z = e.pos[2]
45 msg.twist.linear.x = e.vel[0]
46 msg.twist.linear.y = e.vel[1]
47 msg.twist.linear.z = e.vel[2]
51 msg.pose.orientation = geometry_msgs.msg.Quaternion(*tf_conversions.transformations.quaternion_from_euler(0, 0, e.yaw))
52 msg.twist.angular.x = e.omega[0]
53 msg.twist.angular.y = e.omega[1]
54 msg.twist.angular.z = e.omega[2]