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

Gimbal plugin implementation idea #570

Closed
AlexisTM opened this issue Oct 4, 2018 · 6 comments
Closed

Gimbal plugin implementation idea #570

AlexisTM opened this issue Oct 4, 2018 · 6 comments

Comments

@AlexisTM
Copy link

AlexisTM commented Oct 4, 2018

In the gimbal implementation, why isn't the roll implemented while it is available in the MAVLink message?

develop@/plugins/gimbal/gimbal_impl.cpp

Couldn't it be a better to use individual getter and setters for the gimbal, keeping in memory the command to apply?

void GimbalImpl::set_yaw(float yaw_deg)
{
yaw = yaw_deg;
}
void GimbalImpl::set_pitch(float pitch_deg)
{
pitch = pitch_deg;
}
void GimbalImpl::set_roll(float roll_deg)
{
roll = roll_deg;
}
void GimbalImpl::set_pitch_yaw_roll(float yaw_deg, float pitch_deg, float roll_deg)
{
roll = roll_deg;
pitch = pitch_deg;
yaw = yaw_deg;
}

And an apply function:

Gimbal::Result GimbalImpl::apply()
{
MAVLinkCommands::CommandLong command{};

command.command = MAV_CMD_DO_MOUNT_CONTROL;
command.params.param1 = pitch;
command.params.param2 = roll;
command.params.param3 = yaw;
command.params.param7 = float(MAV_MOUNT_MODE_MAVLINK_TARGETING);
command.target_component_id = _parent->get_autopilot_id();

return gimbal_result_from_command_result(_parent->send_command(command));
}
Gimbal::Result GimbalImpl::apply_async() { ... }
@julianoes
Copy link
Collaborator

Do you have a use case where you need to set roll? I'm interested to hear about it, normally a gimbal just stabilizes roll.

@AlexisTM
Copy link
Author

AlexisTM commented Oct 4, 2018

@julianoes I don't have one personally, that's a very good point.

The feature I miss is to control the zoom (such as Peeper T10x) or shutter for other cameras.

NOTE: Is it possible to control an SBUS gimbal using MAVLink?

@julianoes
Copy link
Collaborator

Hehe, see 😄 .

Zoom is something we don't have a mavlink spec for yet, that's indeed something missing.

NOTE: Is it possible to control an SBUS gimbal using MAVLink?

If the autopilot had a driver implemented for it, yes.

@AlexisTM
Copy link
Author

AlexisTM commented Oct 4, 2018

On top of that, I am using the Offboard mode (PX4 1.8.0+)

@julianoes
Copy link
Collaborator

No one else has asked for roll, so I'm closing this.

@Daybreakerflint
Copy link
Contributor

Daybreakerflint commented Nov 9, 2023

Why would this be needed?

  • Our drone system will be mounted with a dual polarized antenna (Horizontal/Vertical). To test the effects of missaligment to the target, one should be able to set the roll of the antenna.
  • In the cases where two axis are switched, as in my case where I am only able to control yaw and roll, it would be nice to have a workaround to set all three angles.

Implementation idea

  • Setting the quaterion directly
  • A function to set pitch, yaw and roll angle

My situation
I connected my gimbal (Gremsy Pixy U) to my flight controller (Pixhawk 6x) and I want to control exactly where the gimbal is pointing to. In the final version I think ROI will be used but for testing all the functions of the system attached, manual settings will be used.

I am also facing the problem that my pitch and roll angle are switched. So if I set a pitch angle, the roll is set on the gimbal. I have not yet found where the issue is.
Edit: The error was in the mounting. I had the system facing the wrong way. For those who stumble across this. Check on where the gimbal is pointing to.

Cheers.

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

3 participants