Page 1 of 1

Send Thrust, yaw pitch roll command and only use attitude PID controller

Posted: Thu Feb 11, 2021 2:35 pm
by Baoasi
Hi!

I am working with the crazyflie and want to use nmpc instead of Position controller and Velocity controller. Due to the lang computation times I intend to implement nmpc operations on the computer and then send the control commanders(roll, pitch, yaw and thrust) into crazyflie. With the help of function send_position(roll, pitch, yaw and thrust) I can complete this function. But I still have some questions.

1. I dont know weather the commanders(roll,pitch and ) will directly sended to the setpoint in crazyflie.If not, what should I do to achieve it ?
https://github.com/bitcraze/crazyflie-f ... ller_pid.c
void controllerPid(control_t *control, setpoint_t *setpoint , const sensorData_t *sensors, const state_t *state, const uint32_t tick)

2. In https://github.com/bitcraze/crazyflie-f ... der_rpyt.c, in oder to send the angle, should I make all these parameter into 0?

Code: Select all

PARAM_ADD(PARAM_UINT8, althold, &altHoldMode)
PARAM_ADD(PARAM_UINT8, poshold, &posHoldMode)
PARAM_ADD(PARAM_UINT8, posSet, &posSetMode)
Thanks a lot in advance for any help :)
Baosai

Re: Send Thrust, yaw pitch roll command and only use attitude PID controller

Posted: Mon Feb 15, 2021 12:32 pm
by arnaud
Hi,

You can send roll/pitch/yaw/thrust (RPYT) setpoint to the Crazyflie. To answer your questions:

1. The setpoint structure comes from the commander subsystem and is filled up with the latest setpoint received from the radio. There should be no significant delay between receiving a new setpoint over the radio, and it being sent as input to the PID controller.

2. The file you linked is indeed the file implementing the reception and decoding of the RPYT packet. The packet can be sent with this function in the python lib: https://github.com/bitcraze/crazyflie-l ... der.py#L65. To control RPYT you should leave all parameter untouched (ie. to their default value).