Giter Site home page Giter Site logo

Frames about crazyflie_ros HOT 5 CLOSED

eduardo-del avatar eduardo-del commented on August 17, 2024
Frames

from crazyflie_ros.

Comments (5)

whoenig avatar whoenig commented on August 17, 2024

Did you try the "Up axis: Z" setting (see https://crazyswarm.readthedocs.io/en/latest/usage.html#optitrack)?

from crazyflie_ros.

eduardo-del avatar eduardo-del commented on August 17, 2024

Hi, thanks for the answer @whoenig
I'm going to check this https://crazyswarm.readthedocs.io/en/latest/usage.html#optitrack in the morning when i'm in the lab.
In this moment i'm writing a code about the topic for roll, pitch and yaw on vrpn_client_ros.cpp

Doesn't matter that if i use crazyflie_ros and not crazyswarm?, this questions is about the link https://crazyswarm.readthedocs.io/en/latest/usage.html#optitrack

from crazyflie_ros.

whoenig avatar whoenig commented on August 17, 2024

The description there applies regardless. Crazyswarm just has OptiTrack support compiled in, while in crazyflie_ros you need to use a separate node/package.

from crazyflie_ros.

eduardo-del avatar eduardo-del commented on August 17, 2024

Hi @whoenig thanks, all its okay with the frames.

@whoenig I have another issue, i try to do traking on yaw in publish_pose.py but like do you do know
the angles are in quaternions, do you know how can i give the disered to yaw in publish_pose.py?

I trayed the next code but i had an error

`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")
o = 0
x = 0
y = 0
z = 0.5
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]
quaternion = tf.transformations.euler_from_quaternion(0, 0, 0, 0)
msg.pose.orientation.x = euler[0]
msg.pose.orientation.y = euler[1]

pub = rospy.Publisher(name, PoseStamped, queue_size=1)

while not rospy.is_shutdown():	
    msg.header.seq += 1
    o += 0.03
    msg.header.stamp = rospy.Time.now()
    msg.pose.orientation.z = 90*math.sin(2*3.1416*0.05*o)
    pub.publish(msg)
    rate.sleep()`

in the last month i did a sine way in Z, but in this were easy because just changed the msg.pose.position, but here i have quaternion and i wiil like that the angles will be euler angles.

Also the first code that i trayed were it

` pub = rospy.Publisher(name, PoseStamped, queue_size=1)

while not rospy.is_shutdown():
    msg.header.seq += 1
    o += 0.03
    msg.header.stamp = rospy.Time.now()
    yaw = 90*math.sin(2*3.1416*0.1*o)
    pub.publish(msg)
    rate.sleep()`

but the crazyflie didn't the task.

thank you @whoenig

from crazyflie_ros.

whoenig avatar whoenig commented on August 17, 2024

there are helper functions for the conversion, see http://wiki.ros.org/tf2/Tutorials/Quaternions#Think_in_RPY_then_convert_to_quaternion.

Glad to hear that the frames work for you now!

from crazyflie_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.