ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.46k stars 17.11k forks source link

Issue with creating custom frame in ardusub #15730

Closed gezzuzz closed 3 years ago

gezzuzz commented 3 years ago

Bug report

Issue details

When creating a custom frame motor 1 and 2 always spins the same direction even if you give them opposite commands

if I set up the frame like this. I expect giving a forward command that motors will spin opposite directions from each other Using yaw would spin them the same direction

add_motor_raw_6dof(AP_MOTORS_MOT_1,     0,              0,      -1.0f,        0,                    1.0f,              0,            1);
add_motor_raw_6dof(AP_MOTORS_MOT_2,     0,              0,      -1.0f,        0,                  -1.0f,               0,            2);

if I set up the frame like this. I expect giving a forward command that motors will spin same directions from each other Using yaw would spin them the opposite direction

add_motor_raw_6dof(AP_MOTORS_MOT_1,     0,              0,      -1.0f,        0,            1.0f,              0,            1);
add_motor_raw_6dof(AP_MOTORS_MOT_2,     0,              0,       1.0f,        0,             1.0f,               0,            2);

both these setups give the same results. Like there is something hard coded overriding it.

I know i can reverse the direction of the motor in the params but it does not explain the behavior.

Thank you

Version 4.0

Platform [ X] Submarine

Airframe type Custom

Hardware type Pixhawk

gezzuzz commented 3 years ago

I was missing break statement.