ethz-asl / mav_control_rw

Control strategies for rotary wing Micro Aerial Vehicles using ROS
Apache License 2.0
347 stars 159 forks source link

Question About Trajectory Command #32

Closed dangenova closed 4 years ago

dangenova commented 4 years ago

Hello, I am struggling on getting the MPC to work in order UAV to follow a trajectory command. The UAV will follow a command under the /command/pose topic perfectly. However, the UAV flies all over the place when I feed the MPC a trajectory command (the nonlinear MPC cannot solve when it is a trajectory command).

Right now, I am repeatedly (at the same frequency as the odom topic) sending a /trajectory/command topic to the MPC. The topic has the current reference sent in point 1, all the other future points include information on estimated future references. However, the MPC is giving nonsensical roll, pitch, yaw rate commands when considering these future references.

Is this how the trajectory command is supposed to be sent? Does anyone have an example?

fmina commented 4 years ago

Hi, We regularly use the command/trajectory to send full reference trajectory. Maybe make sure you are feeding consistent position, velocity, acceleration in inertial frame. You can also visualise the reference trajectory in rviz, maybe this will help debugging.

dangenova commented 4 years ago

I was only using a position reference. This fixed it.

yiyongrobotics commented 4 years ago

I was only using a position reference. This fixed it.

@dangenova Hi, now I am using this controller, did u also only input /command/pose, not command/trajectory. and did it work in real-time hardware controller? best,

dangenova commented 4 years ago

Yes. I implemented the system on Crazyflie quadcopters. It was able to work with both /command/pose and command/trajectory outputs to the flight controller.

yiyongrobotics commented 4 years ago

Yes. I implemented the system on Crazyflie quadcopters. It was able to work with both /command/pose and command/trajectory outputs to the flight controller.

Hi, how did you map the thrust force(newton ) to the dji thrust command ? and did you directly using newton/full_thrust?