Skip to content
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

SITL: gimbal rotate resets copter's yaw to 0 #15699

Closed
hhackbarth opened this issue Oct 31, 2020 · 6 comments
Closed

SITL: gimbal rotate resets copter's yaw to 0 #15699

hhackbarth opened this issue Oct 31, 2020 · 6 comments

Comments

@hhackbarth
Copy link

hhackbarth commented Oct 31, 2020

Bug report

Issue details
When a MAVLink command is issued to rotate the gimbal, the copter's yaw is reset to 0 degree.

I am using Dronekit 2.9.2 which sends MAVLink commands through pymavlink. The rotate(pitch, roll, yaw) function for the gimbal contains the following code sequence:

        msg = self._vehicle.message_factory.mount_configure_encode(
            0, 1,    # target system, target component
            mavutil.mavlink.MAV_MOUNT_MODE_MAVLINK_TARGETING,  #mount_mode
            1,  # stabilize roll
            1,  # stabilize pitch
            1,  # stabilize yaw
        )
        self._vehicle.send_mavlink(msg)
        msg = self._vehicle.message_factory.mount_control_encode(
            0, 1,    # target system, target component
            pitch * 100,  # pitch is in centidegrees
            roll * 100,  # roll
            yaw * 100,  # yaw is in centidegrees
            0  # save position
        )
        self._vehicle.send_mavlink(msg)

I am not sure, if this also happens in the real world but at least I see this behaviour in SITL. I tested with MNT_TYPE == 4

Version
ArduCopter 4.1.0-dev, Dronekit 2.9.2

Platform
[ ] All
[ ] AntennaTracker
[x] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

Airframe type
Quad

Hardware type
SITL in Mission Planner

Logs

@muramura
Copy link
Contributor

STORM32 does not seem to have PAN control.

@rrr6399
Copy link
Contributor

rrr6399 commented Nov 30, 2020

STORM32 does not seem to have PAN control.

It just has a hard-coded value of false for has_pan() control. If you hard code it to true, the gimbal works as expected and the copter does not yaw.

@amilcarlucas
Copy link
Contributor

Is this a bug? Can it be fixed with a PR?

@IamPete1
Copy link
Member

IamPete1 commented Aug 8, 2021

This seems to be expected behavior for the 2 axis gimbal in SITL.

@rmackay9
Copy link
Contributor

rmackay9 commented Sep 5, 2022

I've reproduced this issue and I have a fix in PR #21639

@rmackay9
Copy link
Contributor

rmackay9 commented Sep 6, 2022

fixed in master and the fix will be included in Copter-4.3

@rmackay9 rmackay9 closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants