castacks / PX4-fully-actuated

PX4 autopilot extended to fully-actuated multirotors
BSD 3-Clause "New" or "Revised" License
33 stars 8 forks source link

How to modify the file hex_tilt_x .toml? #3

Closed daydayupcg137 closed 3 years ago

daydayupcg137 commented 3 years ago
    Hello,Thank you very much for your previous help. Now I can successfully compile your code.But I don't know how to modify your **hex_tilt_x .toml** file according to my own hexrotor. In the file **hex_tilt_x.toml**, name is the position of the motor,  direction is the direction of rotation,and position is the Motor position coordinates.But I don't know how to understand **axis**.

    By the way, I only need to modify the **hex_tilt_x.toml** file for other hexrotor with different wheelbase sizes, right?In your paper, the tilt Angle is 30 degrees. **Is there a range of tilt Angle that this code can achieve? Or must it be 30 degrees?**

    I'm sorry to bother you, but there are a lot of questions.Your reply will be highly appreciated,thank you very much!
keipour commented 3 years ago

Glad to hear that compilation was successfull. In the toml files:

You only need to modify the toml file to use it for other hexarotors with different arm lengths and tilt angles. Just change the fields appropriately for your robot. Theoretically there is no range for the angles, but the more tilt you add to your rotors the less vertical thrust you will have and at some point your thrust will be less than your robot's weight and it won't be able to even take-off.

Note that the body-fixed frame uses the FRD convention, i.e., forward direction is X axis, right direction is Y axis and down is Z axis.

To visualize the toml files when you are modifying them, you can use this tool that I implemented a while ago. It is not well-documented and is not maintained, but it should be easy to work with: https://github.com/keipour/px4_geometry_visualizer

daydayupcg137 commented 3 years ago

Hello, thank you for your reply。 However, I'm still not clear about the definition of "axis". Could you briefly introduce how the unit vector described in the body-fixed frame are calculated for the 1 meter long arm lengths UAV designed by you?

At 2020-12-02 22:36:01, "Azarakhsh Keipour" notifications@github.com wrote:

Glad to hear that compilation was successfull. In the toml files:

name is an arbitrary value used for debugging and has no real effect on the actual system definition. direction is as you mentioned the rotation direction around body-fixed Z axis which can be CW (clockwise) or CCW (counterclockwise). position is the position of the center of rotor w.r.t. the center of mass, described in the body-fixed frame. axis is the axis of rotation of the rotor and should be a unit vector described in the body-fixed frame. You can see other toml files in the same folder to get a better idea.

You only need to modify the toml file to use it for other hexarotors with different arm lengths and tilt angles. Just change the fields appropriately for your robot. Theoretically there is no range for the angles, but the more tilt you add to your rotors the less vertical thrust you will have and at some point your thrust will be less than your robot's weight and it won't be able to even take-off.

Note that the body-fixed frame uses the FRD convention, i.e., forward direction is X axis, right direction is Y axis and down is Z axis.

To visualize the toml files when you are modifying them, you can use this tool that I implemented a while ago. It is not well-documented and is not maintained, but it should be easy to work with: https://github.com/keipour/px4_geometry_visualizer

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

keipour commented 3 years ago

Sorry for the late reply.

To clarify the axis, it is the unit vector normal to the rotor's plane passing through the motor axis and is independent of the length or position of the arm. As an example, axis = [0.0, 0.0, -1.0] means that your rotor points upward (remember that Z is down, so upward in the third element is -1.

As another example, in our tilted hex, the mid_right arm has axis = [0.5, 0.0, -0.866025]. It means that the axis is upward but tilting 30 degrees forward (in X direction). You can see how it looks in this picture:

image

I would suggest playing with the visualizer to see how changing the numbers will change your multirotor. Just make sure you use a unit vector for the axis:

https://github.com/keipour/px4_geometry_visualizer

daydayupcg137 commented 3 years ago
Thank you for your guidance. I have got it.But I still have two questions that I hope you can help me with:
The first one is that I have seen in some literature the tilt distribution in the figure below, they are all x-shaped hexagons, but the tilt direction is not the same as yours, and I would like to ask what is the difference between you?

  The other problem is that after I compiled successfully, I generated files in.elf format and.px4 format, so what I need to burn intoPixhawk is.px4 file, right?By the way,What flight mode do you use to take off?

At 2020-12-05 09:35:52, "Azarakhsh Keipour" notifications@github.com wrote:

Sorry for the late reply.

To clarify the axis, it is the unit vector normal to the rotor's plane passing through the motor axis and is independent of the length or position of the arm. As an example, axis = [0.0, 0.0, -1.0] means that your rotor points upward (remember that Z is down, so upward in the third element is -1.

As another example, in our tilted hex, the mid_right arm has axis = [0.5, 0.0, -0.866025]. It means that the axis is upward but tilting 30 degrees forward (in X direction). You can see how it looks in this picture:

I would suggest playing with the visualizer to see how changing the numbers will change your multirotor. Just make sure you use a unit vector for the axis:

https://github.com/keipour/px4_geometry_visualizer

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

keipour commented 3 years ago

Thank you for your guidance. I have got it. But I still have two questions that I hope you can help me with: The first one is that I have seen in some literature the tilt distribution in the figure below, they are all x-shaped hexagons, but the tilt direction is not the same as yours, and I would like to ask what is the difference between you?

There are some differences in the range of forces and moments that the UAV can generate. Each application may have different demands and there is no single answer to which architecture is the best. I would suggest trying whatever you have and if you want to optimize your design, there are several papers that analyze and optimize the designs for different criteria.

The other problem is that after I compiled successfully, I generated files in.elf format and.px4 format, so what I need to burn intoPixhawk is.px4 file, right?

You need the *.px4 file. Yuo can upload it to your pixhawk using qGroundControl: https://docs.qgroundcontrol.com/master/en/SetupView/Firmware.html#select-firmware-to-load

You will need to select the right airframe and calibrate the sensors after loading the new firmware.

By the way,What flight mode do you use to take off?

We usually take off in Manual mode because our pilots are more comfortable in this mode, but you can take off in whatever mode you are more comfortable.