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

Add AttitudeAngularVelocityBody, AttitudeAngularVelocityBody and ActuatorOutputStatus to telemetry #832

Merged
merged 6 commits into from
Aug 20, 2019

Conversation

irsdkv
Copy link
Collaborator

@irsdkv irsdkv commented Aug 8, 2019

Added:

Related PR in proto: mavlink/MAVSDK-Proto#97

@julianoes
Copy link
Collaborator

Thanks! I'll review it but it might not happen before Monday.

void checkSendsActuatorOutputStatusEvents(
const std::vector<ActuatorOutputStatus>& actuator_output_status_events) const;
ActuatorOutputStatus
createActuatorOutputStatus(const uint8_t group, const float* controls) const;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have to be pointer? What about e.g. a const vector&?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Will do this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed createActuatorControlTarget in the same way.

julianoes
julianoes previously approved these changes Aug 12, 2019
Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good.

@JonasVautherin
Copy link
Collaborator

Let's now update the proto submodule and sync with develop, and I think we can merge 👍

irsdkv added 3 commits August 14, 2019 14:19
Added:
 1. AttitudeAngularSpeed: current angular speed from ATTITUDE_QUATERNION
    message.
    See https://mavlink.io/en/messages/common.html#ATTITUDE_QUATERNION

 2. ActuatorControlTarget: current vehicle attitude and body angular
    rates.
    See https://mavlink.io/en/messages/common.html#SET_ACTUATOR_CONTROL_TARGET

 3. ActuatorOutputStatus: current raw values of the actuator outputs.
    See https://mavlink.io/en/messages/common.html#ACTUATOR_OUTPUT_STATUS
@irsdkv irsdkv force-pushed the pr-add_subscriptions branch 2 times, most recently from 45c5134 to 02cddce Compare August 14, 2019 12:36
1. Updated proto submodule rev,
2. Updated generated grpc modules,
3. Fixed 'proto_dir' in 'generate_from_protos.sh' tool.
@irsdkv irsdkv force-pushed the pr-add_subscriptions branch from 02cddce to ce857a1 Compare August 14, 2019 12:39
@julianoes
Copy link
Collaborator

../../../../../src/plugins/telemetry/telemetry_impl.cpp: In member function 'void mavsdk::TelemetryImpl::process_actuator_control_target(const mavlink_message_t&)':

../../../../../src/plugins/telemetry/telemetry_impl.cpp:732:68: error: taking address of packed member of '__mavlink_actuator_control_target_t' may result in an unaligned pointer value [-Werror=address-of-packed-member]

  732 |         actuator_control_target.group_mlx, actuator_control_target.controls);

      |                                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

../../../../../src/plugins/telemetry/telemetry_impl.cpp: In member function 'void mavsdk::TelemetryImpl::process_actuator_output_status(const mavlink_message_t&)':

../../../../../src/plugins/telemetry/telemetry_impl.cpp:746:86: error: taking address of packed member of '__mavlink_actuator_output_status_t' may result in an unaligned pointer value [-Werror=address-of-packed-member]

  746 |     set_actuator_output_status(actuator_output_status.active, actuator_output_status.actuator);

      |                                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

🤔

@irsdkv
Copy link
Collaborator Author

irsdkv commented Aug 14, 2019

Im also think about that. But at this moment I suppose that this is ok, because of set_actuator_output_status is private method.
Only alternate way is using std::vector, but I think that this is redundant work for the CPU (sorry, I was an embedded developer :-) )
Have you one more idea or you think that "vector-way" is ok in fact?

@irsdkv
Copy link
Collaborator Author

irsdkv commented Aug 14, 2019

Also std::array can be used

@julianoes
Copy link
Collaborator

Also std::array can be used

Sounds good.

julianoes
julianoes previously approved these changes Aug 15, 2019
Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

@julianoes
Copy link
Collaborator

Generating code for file plugin_bas/home/user/DronecodeSDK/tools/docs/install/include/mavsdk/plugins/telemetry/telemetry.h:568: warning: The following parameters of mavsdk::Telemetry::set_rate_actuator_control_target_async(double rate_hz, result_callback_t callback) are not documented:
  parameter 'callback'
/home/user/DronecodeSDK/tools/docs/install/include/mavsdk/plugins/telemetry/telemetry.h:578: warning: The following parameters of mavsdk::Telemetry::set_rate_actuator_output_status_async(double rate_hz, result_callback_t callback) are not documented:
  parameter 'callback'

@julianoes
Copy link
Collaborator

And:

../../../../../src/plugins/telemetry/telemetry_impl.cpp: In member function 'void mavsdk::TelemetryImpl::process_actuator_control_target(const mavlink_message_t&)':
../../../../../src/plugins/telemetry/telemetry_impl.cpp:731:91: error: taking address of packed member of '__mavlink_actuator_control_target_t' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  731 |     auto controls = reinterpret_cast<const std::array<float, 8>&>(actuator_control_target.controls);
      |                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
../../../../../src/plugins/telemetry/telemetry_impl.cpp: In member function 'void mavsdk::TelemetryImpl::process_actuator_output_status(const mavlink_message_t&)':
../../../../../src/plugins/telemetry/telemetry_impl.cpp:748:79: error: taking address of packed member of '__mavlink_actuator_output_status_t' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  748 |         reinterpret_cast<const std::array<float, 32>&>(actuator_output_status.actuator);
      |                                                        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
cc1plus: all warnings being treated as errors

@irsdkv irsdkv force-pushed the pr-add_subscriptions branch 2 times, most recently from ca7b4bf to b1bc91a Compare August 19, 2019 08:48
@irsdkv irsdkv force-pushed the pr-add_subscriptions branch from b1bc91a to 5c7d529 Compare August 19, 2019 08:49
@irsdkv
Copy link
Collaborator Author

irsdkv commented Aug 19, 2019

@julianoes can you please merge PR if it possible?
Or may be I need to do anything else for it?

@julianoes julianoes merged commit 2f48667 into mavlink:develop Aug 20, 2019
@julianoes
Copy link
Collaborator

Thanks @irsdkv!

@irsdkv irsdkv deleted the pr-add_subscriptions branch August 21, 2019 09:27
@JonasVautherin JonasVautherin changed the title Added telemetry subscriptions. Add AttitudeAngularVelocityBody, AttitudeAngularVelocityBody and ActuatorOutputStatus to telemetry Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants