Closed s3xyxavy closed 6 years ago
According to your view frames result, the mocap is not capturing anything.
mocap_optitrack
. If you intend to use VRPN, you won't need that package - the Motive software has a VRPN server built-in. If you want to use mocap_optitrack
, make sure that it works correctly without using crazyflie_ros first by looking at the tf.There is a tutorial style book chapter for crazyflie_ros which has some more details about VRPN: "Flying Multiple UAVs Using ROS", Chapter in Robot Operating System (ROS): The Complete Reference (Volume 2), Springer, 2017. A free preprint is available at act.usc.edu.
Finally, there is the crazyswarm project (see http://crazyswarm.readthedocs.io/en/latest/), if you are interested in flying many CFs. The OptiTrack integration is different there.
Hi whoenig,
Thanks for the reply.
terminate called after throwing an instance of 'tf2::ConnectivityException' what(): Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees. [crazyflie/controller-6] process has died [pid 14946, exit code -6, cmd /home/xavier/fypcrazyflie_ws/devel/lib/crazyflie_controller/crazyflie_controller name:=controller log:=/home/xavier/.ros/log/a05ecc5c-04f8-11e8-8bef-f48c50ec2615/crazyflie-controller-6.log]. log file: /home/xavier/.ros/log/a05ecc5c-04f8-11e8-8bef-f48c50ec2615/crazyflie-controller-6*.log
Whenever I put in the static_transformation from node tf, and I run /tf, it overlaps 2 results one that mocap is tracking. Which in this case my view frames just captured when it switches to static transformation.
How does the view_frames suppose to look like? world > crazyflie > crazyflie_baselink Does this mean I have create a node from mocap to call out for arg: frame?
Hi whoenig,
I have edited the mocap_optitrack file on mocap.yaml, from Robot_1/base_link to crazyflie. And have view_frames as world>crazyflie>crazyflie_baselink I am able to execute the take off command.
The crazyflie is able to take off but not hover, it might be due to weight of the reflective balls. The arg frame of x=0 y=0 z=0.5 does it mean it hovers at coordinate of 0,0,0.5? Or it hovers an additional 0.5 from its original position?
Thank you very much!
Warm regards, Xavier
I am glad the takeoff works now! The coordinates are absolute, so it should hover around 0,0,0.5 in the ROS world frame. Note that the controller is not very good - it should be fine for hovering, but it is not great for trajectory tracking. You achieve better performance if the position controller is running on-board. This works with the Crazyswarm I referenced earlier, and we have some preliminary work that allows to use crazyflie_ros for trajectory tracking with a controller running on-board (see https://github.com/bitcraze/crazyflie-firmware/commit/2a87f5ac84242ac9956d2828a30928bea327d079).
Hi whoenig, My hover has not been successful till now, I have checked the quaternions with the tf, by tilting 90 degree on pitch, roll and yaw axis and it is turning positive and negative respectively, it works good. Coordinates, quarternions work good, but the Crazyflie still slides to the same side for the same 5 test I have been running.
Warm Regards, Xavier
You would need to clone the firmware and build it using make
. Before you do so, adjust the following lines in the Makefile: https://github.com/bitcraze/crazyflie-firmware/blob/master/Makefile#L30-L31. (Replace "any" with "kalman" and "pid" with "mellinger").
Hi whoenig,
Thank you for being so patient with your replies. I have ‘make’ the crazyflie-firmware file, compiled with the rest of the files, but still unfortunatelyun able to hover. I have recorded 2 instances where I execute hovering, hope you can give me more insight into getting it to hover. https://youtu.be/2siXJARX_xk https://youtu.be/r6pqEkCJS7M
I have watched many videos on crazyflie hovering smoothly and hopefully envision it with my crazyflie some day. Appreciate your guidance, many thanks.
Warm Regards, Xavier
In all cases, double check the coordinate system and that it matches the ROS convention. What you showed in the video might very well be an issue with an axis flip, wrong yaw etc.
Hi whoenig,
Yes, got it. I figured if I am not able to hover I would not be able to test the onboard controller.
Will pull the latest crazyflie_ros.
Figured that I couldn’t use the crazyswarm software, as it requires at least 1.10 version for motive (am stuck with 1.7). The onboard controller on the other hand still do work with the ‘old’ crazyflie_ros right? This might very well be that if the TF works on RVIZ it does not mean that the yaw angle is simply correct, yes? I would be probably be working back and relying on VRPN in that case.. Thanks!
Warm Regards, Xavier
Crazyswarm: It should be possible to add other backends, for example by copying the logic from mocap_optitrack
. Also, if you only want to fly with unique marker arrangements, it would be trivial to add a VRPN backend.
The onboard controller works with the "old" crazyflie_ros. The goal is to merge both CF firmwares and crazyflie_ros eventually.
I have seen many issues with OptiTrack because users can apparently choose in Motive which coordinate system to use. If that choice doesn't match what the ROS side expects, the coordinate transformations are all wrong.
Hi whoenig,
I am closing this topic as I have finally found the issue of it. For the benefit of the people who comes across this thread,
The mocap_optitrack only works IF
Your optitrack setup is the same axis coordinate setup as the one that it’s been set.
There is no apparent way to find and edit the codes that exist in mocap_optitrack.
I reccomend using VRPN, as it directly streams the whatever coordinates without any rotations or edit fresh from Optitrack.
You could look into the other users editing the VRPN changing its axis by transforming such example codes are as from crigroup from NTU (Nanyang Technological University) or eth-zasl (uses a PI/2 rotation).
For beginners that just started researching on Optitrack and ROS integration, could take note that when editing cpp files in VRPN and allocating the VRPN file with whoenig crazyflie_demo files where it contains nodes code editing please remember to:
Please don’t hesitate to direct message me! A University of Glasgow student, Xavier Leong.
Warm Regards, Xavier
Hi whoenig I have the trouble with flying crazyflie2.0 with optitrack. I use vrpn_client_ros to get the position and the rotation of the fly. But now I don't know how to hover at (0,0,1),and I have another question,do I need to run rosservice call /crazyflie/takeoff before I do any other motion like waypoint?
I am currently in the process to integrate a new high-level commander into the official firmware and crazyflie_ros. The "old" way is described in W. Hönig and N. Ayanian. "Flying Multiple UAVs Using ROS", Chapter in Robot Operating System (ROS): The Complete Reference (Volume 2), Springer, 2017. (see http://act.usc.edu/publications.html for a free pre-print). The "new" way will use an on-board controller and planner and is still work-in-progress.
Oh, I am so glad to get your response, and I get the paper yesterday. And I have another question, if I don't have the joystick, I want to use gazebo to simulate the flying, use the ground_truth value in gazebo replacing the motion capture system, what should I do?
Unfortunately, we don't have gazebo support yet. I recommend testing high-level algorithms without Gazebo first. If you want to test with UAV dynamics, you can use a package such as RotorS to simulate a UAV within Gazebo.
Hi, @s3xyxavy ;
I cannot execute the take off command, when launch hover_vrpn.launch.
Error occurred like
Exception thrown while processing service call: Could not find a connection between 'world' and 'crazyflie' because they are not part of the same tree.Tf has two or more unconnected trees.
You seem to have solved this problem by changing the program like
I have edited the mocap_optitrack file on mocap.yaml, from Robot_1/base_link to crazyflie. And have view_frames as world>crazyflie>crazyflie_baselink I am able to execute the take off command.
Does it mean you didn't change crazyflie_demo to connect 'world' and 'crazyflie', but changed other package file?
Best regards, Shumpei
OK, I've done, thank you. Looking at #126.
Hi whoenig,
I am currently working on the hover launch using mocap_optitrack. After creating the folder with mocap, in it, I am able to run the hover_vrpn.launch changing to mocap files accordingly. I have also been keeping close check on issue 15 and issue 17. I am able to visuallize the tracking of crazyflie on the RVIZ but the problem comes in when I try to execute the taking off. Please do note that I am pretty new in ROS and if possible guide me through any tutorials I should take a look at. I am currently using Ubuntu 14.04 Indigo. The files, view_frames, the error log file and the launch file, relevant are attached in the Dropbox link: https://www.dropbox.com/sh/uf3ryxdbvlfma03/AAAlkzkckq6dVgnsOyRNtiaoa?dl=0 I hope you can assist me in it, please let me know if You still require any more log or issuing of commands. Thank you very much
Warm regards, Xavier