Unclear on how to retrieve drone location
I wasn't able to understand how we are supposed to get the drone positions. explored options :
-
tf
in the current setup, no transforms are published. I believe that is quite weird given what I understood from the internals ofcrazyflie_driver. And from youcrazyflie.pymodule ( that had by the way a weird way to handle constructor arguments, seecrazyflie.toolmodule where I tried to correct it...but withouttfit still doesn`t work -
/cf/local_positiontopic That way I get a 6-d vector, the 3 first being the pose. However, the last three don't seem to map to roll, pitch, yaw. According tocrazyflie_add_single.launch, these value correspond to"stabilizer.roll", "stabilizer.pitch", "stabilizer.yaw"
Although the models in gazebo are perfectly horizontal, those values (roll, pitch) are non-null.
-
cf/posetopic (mentionned incrazyflie_visu.rvizfile) I don't have this topic
Do you have any advice on that matter? That might be useful to mention that in the documentation
- /cf/pose in crazyflie_visu.rviz is an old version when I was still using pose to publish position information. It shouldn't be in the recent sim_cf version normally.
- /cf/local_position is 6-d vector. the first 3 being the position and the 3 last are roll, pitch, yaw values in degree not radians. So even when in gazebo it's perfectly horizontal, gazebo sends the true sensors values with some noises. This is why you won't have null value for these even when it is on the ground. What is the range of these values ? (don't forget it's in degree)
- tf : well tbh this was a choice of design to get rid of it. There is the issue : I wanted the user to be able to choose by himself the logs he wanted to obtain from crazyflie. And you may have noticed it, general logs are obtained via the GenericLog (as in crazyflie_add_single.launch) and the data you obtain are sent in a vector. the pose is obtained using this, that's why it doesn't have any tf. However, you can create a ros node that subscribe to that topic and convert that vector to a pose with the tf you want. The last sim_cf version was doing that by fetching automatically the position and euler angles (hard coded), but I noticed it takes a lot of bandwidth and getting too much log can affect performances that's why I let the user the possibility to specify what he want (maybe just x,y,z without angles or x,z it's up to him). The less log the better I believe
A bit late, but thanks ! That might deserve another issue: the logging topic /cf/local_position sometimes returns zero values instead of the correct position.
Expected behaviour
Get consistent position messages in the same (say) second
Observed behaviour
Some messages are produced with zero-only values. In the following examle, they are the even-numbered seq.
# cf1 is simulated
$ rostopic echo /cf1/local_position
stamp:
secs: 293
nsecs: 628000000
frame_id: "cf1/base_link"
values: [0.9986013770103455, 0.998471200466156, 0.03146503120660782, -0.14742575585842133, -0.18336021900177002, -0.08680407702922821]
---
header:
seq: 58658
stamp:
secs: 293
nsecs: 630000000
frame_id: "cf1/base_link"
values: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
header:
seq: 58659
stamp:
secs: 293
nsecs: 630000000
frame_id: "cf1/base_link"
values: [0.9986578226089478, 0.9985325932502747, 0.03146322816610336, -0.1475960612297058, -0.18361333012580872, -0.08645530790090561]
---
header:
seq: 58660
stamp:
secs: 293
nsecs: 636000000
frame_id: "cf1/base_link"
values: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
^Cheader:
seq: 58661
stamp:
secs: 293
nsecs: 640000000
frame_id: "cf1/base_link"
values: [0.9986107349395752, 0.9984825849533081, 0.03145763278007507, -0.14709217846393585, -0.18389186263084412, -0.08607463538646698]
---
header:
seq: 58662
stamp:
secs: 293
nsecs: 642000000
frame_id: "cf1/base_link"
values: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
header:
seq: 58663
stamp:
secs: 293
nsecs: 642000000
frame_id: "cf1/base_link"
values: [0.9985549449920654, 0.998424768447876, 0.03145177662372589, -0.14745797216892242, -0.18474014103412628, -0.08621597290039062]
---
I solved this ! I'm going to push a commit when I will have a viable solution for this issue "Gazebo crash on /delete_model service calls"
I am running the max_cf_sitl.launch file. Any idea how to retrieve the drone location ?. I have tried with /cf1/local_position topic, but no messages on that topic
There is no such a topic to retrieve drone location. Is anyone able to get it?