Page 1 of 1
Continuous signal with crazyflie_ros
Posted: Tue May 26, 2020 7:14 pm
by EduardoAguilar
Hello everyone
I would like to know if you can help me with something,
I am working with crazyflie_ws in the crazyflie_ros folder
https://github.com/whoenig/crazyflie_ros, specifically there is a file named pose.publish.py
https://github.com/whoenig/crazyflie_ro ... sh_pose.py
and this generates the desired points for x, y and z, but these are only constants,
I would like to know if I can enter a variant signal in time as it is a signal sine,
thank you very much.
Re: Continuous signal with crazyflie_ros
Posted: Wed May 27, 2020 6:23 am
by EduardoAguilar
Im traying with this pose.publish.py
Code: Select all
#!/usr/bin/env python
import rospy
import math
import tf
from geometry_msgs.msg import PoseStamped
if __name__ == '__main__':
rospy.init_node('publish_pose', anonymous=True)
worldFrame = rospy.get_param("~worldFrame", "/world")
name = rospy.get_param("~name")
r = rospy.get_param("~rate")
t = rospy.get_time()
x = 0
y = 0
z = 0.3*math.sin(2*3.1416*0.05*t) + 0.6
rate = rospy.Rate(r)
msg = PoseStamped()
msg.header.seq = 0
msg.header.stamp = rospy.Time.now()
msg.header.frame_id = worldFrame
msg.pose.position.x = x
msg.pose.position.y = y
msg.pose.position.z = z
quaternion = tf.transformations.quaternion_from_euler(0, 0, 0)
msg.pose.orientation.x = quaternion[0]
msg.pose.orientation.y = quaternion[1]
msg.pose.orientation.z = quaternion[2]
msg.pose.orientation.w = quaternion[3]
pub = rospy.Publisher(name, PoseStamped, queue_size=1)
while not rospy.is_shutdown():
msg.header.seq += 1
msg.header.stamp = rospy.Time.now()
pub.publish(msg)
rate.sleep()
and really i haven't a good results, someone can help me?
thank you!!
when read my topic on rosbag just i have a constant
and this is incorrect i think that z_goal maybe will be a sine
Re: Continuous signal with crazyflie_ros
Posted: Wed May 27, 2020 6:54 am
by kimberly
This thread contains a copy of an issue of
https://github.com/whoenig/crazyflie_ros. This is probably a better location for that, although it seems more like a ROS question than a crazyflie_ros question.
Also try to not double post please.
Re: Continuous signal with crazyflie_ros
Posted: Wed May 27, 2020 3:44 pm
by EduardoAguilar
Thank you Kimberly
