-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Including Yaw setpoint in the FlatTarget Msg #153
Comments
@mzahana You are right, this was something that was at the back of my head, but didn't have time to do. One note is that we need a way to invalidate yaw setpoint in case you want to ignore it, but should be quite straight forward to add |
@Jaeyoung-Lim Following @mzahana if we consider that the drone is equipped with a camera, it will be great to include the yaw and yaw velocity in the flattargetCallback and thus in the computeBodyRateCmd. What will be the modification in the equations and if we want to implement it, which paper(s) do we have to read? The idea is to couple fastplanner (from hkust) and mavros_controller. |
@FaboNo Have you looked at px4_fast_planner package where I did the required interface between FastPlanner and mavros_controllers? |
The missing piece is the yaw rate which is not implemented in the geometric_controller, but it's doable. |
@FaboNo Nothing much to add since yaw is already handled in the controller through a different message. As @mzahana mentioned, he already integrated into the HKUST fast planner in https://github.com/mzahana/px4_fast_planner so might be worth looking into that. On adding yaw rate, I am not sure if is worth it. Quadrotor systems are differentially flat and yaw rate is usually not part of the flat outputs - meaning that yaw rate commands are unnecessary in most cases. - This might be worth discussing: why do you need to control yaw rates? |
@mzahana thank you I will have a look |
@Jaeyoung-Lim Ah interesting I will dig into it:) |
@FaboNo Any updates? I would be happy to support you on this |
I read the two articles you mentioned to understand how you implemented the geometric controller and I have few questions: in The geometric controller with mavros/PX4 implement the control laws from Faessler et al. paper but without the rotor drag components because it is easier to integrate with Mavros/px4? Indeed other implementation such as Lee et al requires the knowledge of J (inertia matrix), mass ... In
But in the Faessler et al. paper : In On another thread, regarding a real implementation on a drone, you mentioned three steps: Can you tell me what do you mean in point (b) ? I started to look at the pr #35 and look at this link: Does it mean that you implemented the possibility to include a yaw_rate in the controller in another branch? Thanks again for your support |
@FaboNo I think the confusion comes from the expectation that this package is a direct implementation of some of the literatures, while it is not. It is definitely based on some of the main ideas mentioned on both of the papers but the details have been adapted to better work with real vehicles running PX4.
As it is clear in the paper, the drag coefficents are usually not a constant . It depends on both the trajectory and the vehicle parameters - revealing that the nature of the drag is indeed not linear as modeled in the paper. Therefore I set the drag coeffients all to zero as default so that people can adjust it to their needs.
This is because in Lee(2010), the controller is based on force / moments. This is not a good idea on implementing on real systems since you cannot control force/moments reliably. Therefore this package uses bodyrate setpoints + thrust as a setpoint and only take the attitude error function from the paper in the implementation: mavros_controllers/geometric_controller/src/geometric_controller.cpp Lines 442 to 466 in b955fd8
You cannot control the thrust of the vehicle in offboard mode of PX4. The thrust commands that we can send are normalized thrust setpoints, which range from
It is not possible for PX4 to know how much thrust max thrust commands would produce, since this depends on what motors/voltage/props the vehicle is using for its propulsion. Therefore PX4 considers thrust inputs as normalized thrust inputs. Therefore the Hope this helps |
@Jaeyoung-Lim great explanations! Yes it helps a lot to clarify the points which were unclear to me... and it confirms that implementing a geometric controller on a real drone is not an easy task! |
@FaboNo In the end, it is not that complicated. It is just that it is not easy to control force with normal ESCs since there is no feedback therefore it is better to avoid using force / moment based controls in the first place. |
@mzahana Are you still using this package and have plans to move forward with the yaw setpoints? |
@Jaeyoung-Lim Sorry for getting disconnected from this issue, I am short on time at the time being. I use this package on demand, i.e. depending on the project(s) I work on. At the time being, I am not using it. However, I still believe that the yaw setpoint should be in the flat target callback, and msg. I have had the intention to submit a PR for this, but not soon as I am swamped with other tasks with higher priorities. So, maybe next month, unless someone else is generous and does it earlier. On a side note, I was also interested to add integral action in the controller to correct for steady-state error as the current controller acts like a PD and won't respond to steady-state errors. I saw one paper from Martin Saska's group did that, and since then I had the intention to do it, but again, short on time! This would be a separate issue/PR though. Thanks for the follow up. |
@mzahana man,can you share the paper from Martin Saska's group ? I will appreciate it. |
@958117216 |
I am adding yaw field on the FlatTarget.msg. But i am having a compilation error: Errors << geometric_controller:make /home/bruno/catkin_ws/logs/geometric_controller/build.make.004.log This is the message definition: geometry_msgs/Vector3 position
|
@brunopinto900 Your message definition is not updated. Do it after 'catkin clean' |
I tried that before opening the issue xD, didn't work either. |
@brunopinto900 Then there is something wrong with your workapace path |
Had to execute catkin clean on other workspace, that was somehow interfering with the mavros_controller workspace. Everything is working right now. |
To test the yaw field in the FlatTarget.msg, i requested the quadrotor to fly a circle while pointing (yaw) to the center of rotation. Here is the results: RVIZ.mp4GAZEBO.mp4I added in the shapeTrajectory.cpp the following code: float shapetrajectory::getYaw(double time) { float yaw; switch (type_) {
} return yaw; What do you think? |
@brunopinto900 Looks good! but please make a pull request, so that we can discuss the details. I can review the code before we merge it in. |
Hi @Jaeyoung-Lim
I was looking at the flattargetCallback, and I don't see it accepting yaw setpoint. I know there is another callback just for yaw setpoint yawtargetCallback. I was wondering why not to also add yaw setpoint in the FlatTarget.msg in order to allow all setpoints to be set in one message and published to a single topic with the same timestamp instead of having them separated in two different topics which could possibly be published at different timestamps (even for the same setpoints). Is there a reason for that?
Thanks.
The text was updated successfully, but these errors were encountered: