PX4 / jMAVSim

Simple multirotor simulator with MAVLink protocol support
BSD 3-Clause "New" or "Revised" License
82 stars 207 forks source link

fix bug in body-fixed XYZ Euler angles #36

Closed kd0aij closed 7 years ago

kd0aij commented 7 years ago

This changes the Euler angle calculation to match the one in the PX4/Firmware ecl library; so that the order of the Euler angles is RPY (XYZ), instead of the previous (pitch, roll, yaw).

bkueng commented 7 years ago

Looks good. I think this function needs to be updated as well: https://github.com/PX4/jMAVSim/blob/master/src/me/drton/jmavsim/CameraGimbal2D.java#L116 I didn't even know jMAVSim has gimbal simulation.

LorenzMeier commented 7 years ago

@kd0aij Can you update the gimbal sim?

kd0aij commented 7 years ago

@bkueng @LorenzMeier That code matches the description here: https://github.com/PX4/Firmware/blob/master/msg/manual_control_setpoint.msg#L25 I don't know why the "x" axis in the manual control message would be considered the pitch axis (and y roll), but that's the way it is. And there are no comments in jmavsim explaining the intention there either :)

bkueng commented 7 years ago

@kd0aij yes, the for the manual_control_setpoint it's swapped too. It's because it comes from the mavlink message, and we cannot really change that. But I don't think it's related to the jMAVSim gimbal code, because the gimbal uses the actuator control outputs, which is defined by the mixer config. Plus gimbal sim channels can be configured. So I still think gimbal sim needs to be updated to be consistent with the rest of jMAVSim.

kd0aij commented 7 years ago

@bkueng Sounds like you know more about this than I do. Feel free to change it any way you want.

bkueng commented 7 years ago

continued in #37