[SOLVED] publishing Pose values

Post here to get support
Post Reply
jkooi
Beginner
Posts: 3
Joined: Tue Oct 20, 2020 7:51 am

[SOLVED] publishing Pose values

Post by jkooi »

Hey,

I cannot seem to find a way to publish the Crazyflie's onboard Pose estimation values on ROS. I want to be able to use the Roll Pitch Yaw estimates to put in a neural network. I am using the crazyflie_ros package, and the crazyflie server does not automatically seem to publish these pose values. I have checked the crazyflie_server.cpp code and it looks like it should be publishing.

In short: Is there an easy way to publish the orientation angles that the cfclient shows?

I am using the latest firmware and a Crazyradio with a Crazyflie 2.1

Kind regards,

Jacob
Last edited by jkooi on Tue Nov 10, 2020 4:14 pm, edited 1 time in total.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: publishing Pose values

Post by kimberly »

I quickly looked at the code as well. I guess you are talking about this line right? https://github.com/whoenig/crazyflie_ro ... r.cpp#L700

It seems that some boolean to enable logging should be turned to True ( see here)
jkooi
Beginner
Posts: 3
Joined: Tue Oct 20, 2020 7:51 am

Re: publishing Pose values

Post by jkooi »

Hey Kimberly,

Yes, i was talking about talking about that line which gives the appearance that it should be published.

I have tried to set the boolean m_enable_logging_pose to true in the private part without success (https://github.com/whoenig/crazyflie_ro ... r.cpp#L859). I am also not seeing the other enable_logging booleans being explicitly set to true, while these are being successfully published. The topics published are:

/cf1/battery
/cf1/cmd_full_state
/cf1/cmd_hover
/cf1/cmd_position
/cf1/cmd_stop
/cf1/cmd_vel
/cf1/cmd_velocity_world
/cf1/external_pose
/cf1/external_position
/cf1/imu
/cf1/magnetic_field
/cf1/packets
/cf1/pressure
/cf1/rssi
/cf1/temperature

Is there anything i could have missed?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: publishing Pose values

Post by whoenig »

You need to set "enable_logging" and "enable_logging_pose" to True in your launch file (see https://github.com/whoenig/crazyflie_ro ... ch#L19-L20 for an example that has "enable_logging_pose" missing).
jkooi
Beginner
Posts: 3
Joined: Tue Oct 20, 2020 7:51 am

Re: publishing Pose values

Post by jkooi »

Thank you whoenig, this worked. Also thank you kimberly for looking into it.
Post Reply