OPT4SMART / crazychoir

Flying Swarms of Crazyflie Quadrotors in ROS 2
https://opt4smart.github.io/crazychoir/
GNU General Public License v3.0
37 stars 3 forks source link

Help with RadioHandlerXYZ #20

Closed ctab-0120 closed 1 month ago

ctab-0120 commented 2 months ago

Hi, I am having some issues in understanding how to use the RadioHandlerXYZ. It is my understanding that to use it you send position commands to the CF, is that correct? Which topic should I publish this information to? Running the examples, it seems to me that you are using a trajectory_msgs/JointTrajectoryPoint that requires also velocity and acceleration though. I would appreciate any help to understand the structure better. Thanks in advance!

lorenzopichierri commented 2 months ago

Hi @ctab-0120,

Thank you for your interest in our toolbox!

Your understanding is correct! In the parent class of RadioHandlerXYZ, RadioHandler, there's a selector at line 109 that defines the message type. You can choose the type of message based on your sender. In fact, in this example ( see line 65 ), where we send position setpoints, we specify traj_params as the cmd_topic in the parameters of the radio node.

As you can see here, only the setpoint positions are used to send the reference to the Crazyflie. Thus, in this case, you are not required to generate also velocity and acceleration setpoints to govern the Crazyflie with RadioHandlerXYZ because they are computed by the high-level commander used in (line 31)[https://github.com/OPT4SMART/crazychoir/blob/1e5e79706005236a36249605eccabbe59e2a63fb/crazychoir/crazychoir/radio_handler/radio_handler_xyz.py#L31].

I hope this clarifies your doubts, but feel free to reach out again if you have any more questions.

Best,
Lorenzo