I am working on Autonomous Drones using Mavros and PX4 both in SITL and real time.
For now, I am writing the controller which will give me the forces and torques. However, I have developed the control allocation matrix to get relationship between F/torques and motor angular velocities.
I have seen some useful discussions about control the drone using /mavros/actuator_control or /mavros/target_actuator_control. I have some confusion so please help me.
It is mentioned that the “controls” in /mavros/actuator_control topics are servo raw outputs, however they are actually responsible for thrust and torques (roll-pitch-yaw). I have a question, when we command on roll-pitch-yaw and thrust in /mavros/actuator_control topic, do they pass through the Mixer File in Firmware?
In Offboard mode, when we command to actuator topics so only [Mixer].mix file is used or MulticopterMixer.cpp is also used. I am confused here.
Could some one link me how the flow will actually work after I command on /mavros_actuator control.
Hi, I have read your questions. You are somewhat confusing yourself
Let say you already have the Effectiveness matrix ‘G’ from geometry. Lets keep it for a while.
Now go the control structure of drone.
what we have PD type position control that will give us error in position and velocity.
Then we normally try to compute the drone desired attitude usually Rotation matrix or quaternion.
This will help us to develop attitude control.
Basically position control gives us commulative thrust and desired attitude. The attitude control gives us desired body torques. Now you have a 4x1 vector like (F, taux, tauy, tauz).transpose().
I noted that px4 mixing matrices are constant ones for each special config and not related to momentum arms. However, I still don’t know how to define delta_T_sp using the acceleration setpoints coming from the velocity control part. I would apprecaite your help.
Hi @Jawad-RoboLearn. I’m trying to control the actuators of quadcopter in both SITL and real-time using torque and thrust inputs. Based on what you said about "controls” in /mavros/actuator_control topics being responsible for thrust and torques, I want to ask if it is possible to control the motors with these commands because I’m not able to do so with the following code:
Before running the above script, I’m running a script which first sets the drone in offboard mode using the ‘mavros/set_mode’ service and the drone moves to an altitude of 1m.
After running the second script, I stop the first one(which sets the drone in offboard mode) to observe if the motor commands are observable. But it is not working as desired. I’m implementing this using PX4-Autopilot v1.11.2 in gazebo-sitl. Any idea where I’m going wrong?