-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Added gimbal plugin #124
Added gimbal plugin #124
Conversation
plugins/gimbal/gimbal.h
Outdated
UNKNOWN | ||
}; | ||
|
||
static const char *result_str(Result result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No docs on any of this.
plugins/gimbal/gimbal.h
Outdated
static const char *result_str(Result result); | ||
|
||
typedef std::function<void(Result)> result_callback_t; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add docs and make clear co-ordinate frame used.
plugins/gimbal/gimbal.h
Outdated
explicit Gimbal(GimbalImpl *impl); | ||
~Gimbal(); | ||
|
||
enum class Result { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only this set? Can a camera not return CommandDenied, Busy or whatever?
So is component ID = 1 the autopilot? - ie we're assuming that the gimbal is part of the autopilot? Don't Yuneec use a MAVLink camera? I.e. don't we already have a case of a camera that might have a separate component ID? I'd be tempted to add a mechanism to support that now. If not, then this "limitation" should be part of the documentation. A few other thoughts:
|
Both cases are possible. I'm not sure which one makes sense to implement, and an automatic mechanism needs a bit more work. For instance, you can check if you have received heartbeats from a gimbal component ID. If yes, you send the commands there, otherwise to the autopilot.
If you have different component IDs for the multiple gimbals, yes. Right now, only one exists MAV_COMP_ID_GIMBAL.
It would be heartbeats being sent from the gimbal component ID, as suggested above.
There is roll but I have never seen a drone that wants to have a roll axis different from horizontal 😄
This is all hypothetical. We can add/implement this when there is an actual use case.
No idea. I have to ignore anything that does not have a real use case right now. There are endless possibilities. |
@julianoes please rebase |
This adds a plugin which can set pitch and yaw angle of a gimbal. Currently, the commands are sent to component ID 1, so the assumption is that the gimbal is connected to the autopilot and not talking mavlink itself. This could change or be made adaptable in the future.
OK, so re that whole discussion, sure - no point implementing anything that has no real use case. I still lean towards proper support for MAVLink camera though - on the basis that it sounds like we do have real use cases. |
Support for a mavlink camera? Absolutely! But this is just for a gimbal, and I don't know of a mavlink gimbal yet. |
OK, good point. I'll got back to my corner now. Happy for this to go out. Just FMI, is it possible to get confirmation that the gimbal has reached its target attitude? |
So if a gimbal sends MOUNT_ORIENTATION that's what you can use to track the actual angle. |
Should we expose the current orientation through this API? |
@hamishwillee yes you're right, we should expose it. I'm just wondering if we should expose it in |
I think we can add that in |
Sounds good. I added #141 to track this. I tend to agree "Telemetry" is the right place for this, but it isn't a strong belief and you could easily convince me otherwise. Either way, if it goes in Telemetry we should add cross link/info in Gimbal docs. |
This adds a plugin which can set pitch and yaw angle of a gimbal.
Currently, the commands are sent to component ID 1, so the assumption is
that the gimbal is connected to the autopilot and not talking mavlink
itself. This could change or be made adaptable in the future.