Offboard position controller

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
dpl
Beginner
Posts: 7
Joined: Thu May 20, 2021 8:41 am

Offboard position controller

Post by dpl »

Hello all,

Currently I got the task to implement an offboard PID controller for the crazyflie in ROS with the Lighthousesystem.
At the moment I am a bit confused where to start and what I need to do. So far I tried to work with crazyflie_ros (https://github.com/whoenig/crazyflie_ros). It is not for the Lighthousesystem , but I receive the stateEstimator and PoseStamped data.

Would it be the right way to use the /pose (which I recieve by enable_logging_pose)data and run it through a PID (on the Rasberry Pi) and send the desired pitch and roll back to the onbaord atitude-controller (via sentPoint)?

Is there a easy way or a need to disable the onboard postion-controller, so the atitudecontroller receive my offboard data ?

Kind regards
dpl
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Offboard position controller

Post by kimberly »

Hi!

Technically it would be possible to do this. The onboard position/velocity controller outputs attitude setpoints to the lowlevel controllers, so that is exactly what you can do as well. Your offboard controller would need to send attitude setpoints to the crazyflie. From the Crazyflie-lib-python (cflib) you would do that through this setpoint command but not sure for the crazyswarm project

Just some questions about your request:
- Does this need to be done by ROS?
- Where does the Raspberry pi fit in and would it be okay to start from a computer first?
dpl
Beginner
Posts: 7
Joined: Thu May 20, 2021 8:41 am

Re: Offboard position controller

Post by dpl »

Hi kimberly,

thank you very much for your response. It helped me a lot!

Except using the cflib setpoint command, it seems that something like this is already implemented in the crazyflie_cpp for ROS https://github.com/whoenig/crazyflie_cp ... e.cpp#L169

There is still one question I have about the different modes I was reading about https://www.bitcraze.io/documentation/r ... der-module
For what I try to achieve, do I need to set the mode to disable (if yes, where do I set this and do I need to flash it or can I set this as a parameter) or will the mode not have an impact if I only send roll, pitch, yaw, thrust to the crazyflie ?

Yes this is wished to be done in ROS as a base for further projects. We want to know how (much) the latency impact the offboard controller while only using the Lighthousesystem.
It was just requested to have a full setup rasberry pi with a working offboard controller.


Kind regards,
dpl
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Offboard position controller

Post by kimberly »

I'm not sure to which mode you are referring too, but if you send those yaw pitch roll setpoint directly from ROS or CFLIB then the position modes of the setpoint structure are automatically set on disabled.
Post Reply