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

sensors: create vehicle_angular_velocity module #12596

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

dagar
Copy link
Member

@dagar dagar commented Aug 1, 2019

This is a new part of the sensors module that creates the system wide angular velocity message needed by the rate controllers and several other modules. Because this message is needed at a relatively high rate (250 Hz now, >= 1 kHz shortly) with absolute minimum latency it runs out of the WQ rate_ctrl.

vehicle_angular_velocity

uint64 timestamp		# time since system start (microseconds)
uint64 timestamp_sample		# the timestamp of the raw data (microseconds)
float32[3] xyz			# Bias corrected angular velocity about X, Y, Z body axis in rad/s

@dagar
Copy link
Member Author

dagar commented Aug 1, 2019

Fixes #12451 (hopefully).

@dagar
Copy link
Member Author

dagar commented Aug 1, 2019

The rollspeed, pitchspeed, and yawspeed in the vehicle_attitude message (now removed) are from raw IMU data integrated down to 250 Hz. For the majority of consumers it's clear what they actually want is the low pass filtered rate data (now in vehicle_angular_velocity), but there may be exceptions.

@dagar dagar force-pushed the pr-vehicle_angular_velocity branch 3 times, most recently from 36152e2 to 95a19e4 Compare August 1, 2019 14:37
@dagar dagar requested a review from bkueng August 1, 2019 14:38
@jlecoeur
Copy link
Contributor

jlecoeur commented Aug 1, 2019

The CI failure is related to RTPS:

AssertionError: 

The following message is not listen under  /tmp/jenkins/workspace/4_misc_Firmware-compile_PR-12596/msg/tools/uorb_rtps_message_ids.yaml: vehicle_angular_velocity
Please add them to the yaml file with the respective ID and, if applicable, mark themto be sent or received by the micro-RTPS bridge.
NOTE: If the message has multi-topics (#TOPICS), these should be added as well.

@dagar
Copy link
Member Author

dagar commented Aug 1, 2019

Thanks @jlecoeur, should be fixed now.

Copy link
Contributor

@jlecoeur jlecoeur left a comment

Choose a reason for hiding this comment

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

Much needed cleanup!

I have made some suggestions and asked a few questions.

msg/rate_ctrl_status.msg Show resolved Hide resolved
msg/vehicle_attitude.msg Show resolved Hide resolved
msg/vehicle_angular_velocity.msg Outdated Show resolved Hide resolved
src/modules/land_detector/MulticopterLandDetector.h Outdated Show resolved Hide resolved
src/modules/sih/sih.cpp Show resolved Hide resolved
src/modules/simulator/simulator_mavlink.cpp Show resolved Hide resolved
@dagar
Copy link
Member Author

dagar commented Aug 1, 2019

Thanks for the quick review @jlecoeur.

@dagar dagar requested a review from jlecoeur August 1, 2019 18:09
@dagar dagar force-pushed the pr-vehicle_angular_velocity branch from 00a2bbc to c2d0def Compare August 1, 2019 18:11
@dagar dagar requested a review from a team August 1, 2019 20:08
jlecoeur
jlecoeur previously approved these changes Aug 2, 2019
@jorge789
Copy link

jorge789 commented Aug 2, 2019

Tested on Pixhawk 2 Cube V3:

Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL: Good.

- Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoin activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

Log:
https://review.px4.io/plot_app?log=7016078b-38d7-4d9b-9e3d-c3041354b093

Tested on PixRacer V4:
Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL: Good.

- Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoin activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

Log:
https://review.px4.io/plot_app?log=95bb9558-b81b-41a4-972b-7696b9aab454

https://review.px4.io/plot_app?log=0fbcb9c3-9bfd-4b23-8b91-1f07a10626ed

Tested on CUAV V5+
Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL: Good.

- Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoin activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

Log:
https://review.px4.io/plot_app?log=7e8641dc-4910-4ed8-8480-a9d460d8d366

https://review.px4.io/plot_app?log=5006f107-db4d-469f-832d-01fa0f99e04a

 - mc_att_control split out sensor_gyro aggregation and move to wq:rate_ctrl
@dagar
Copy link
Member Author

dagar commented Aug 2, 2019

Conflict with position_estimator_inav (deleted) fixed manually, then squashed and rebased on master.

@dagar dagar force-pushed the pr-vehicle_angular_velocity branch from a9b4522 to 4b43c1c Compare August 2, 2019 21:50
@dannyfpv
Copy link

dannyfpv commented Aug 2, 2019

Modes Tested

Position Mode: no issue
Altitude Mode: no issue
Stabilized Mode: no issue
Mission Plan Mode : no issue
RTL: no issue

  • Procedure
    Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoin activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

pr log pixhawk 4 v5 f-450:
https://review.px4.io/plot_app?log=070e2fbe-f0e5-41a1-a0ef-c9eb7d37acb8

pr log pixhawk 4 mini v5 f-450:
https://review.px4.io/plot_app?log=dfdd5c08-8b65-4817-b528-6a425816b2e8

pr log pixhawk pro v4 f-450
https://review.px4.io/plot_app?log=89bbc48a-df07-4437-a8fc-d20ccb11b45a

@jlecoeur jlecoeur self-requested a review August 3, 2019 07:07
@dagar dagar merged commit 2ad12d7 into PX4:master Aug 6, 2019
@dagar dagar deleted the pr-vehicle_angular_velocity branch August 6, 2019 16:55
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

I can see the reasoning, but I find it weird to run this from sensors:

  • it does not interact with that module, or share anything
  • and it even runs on a different process

@@ -610,15 +610,16 @@ void Logger::add_default_topics()
add_topic("optical_flow", 50);
add_topic("position_setpoint_triplet", 200);
//add_topic("radio_status");
add_topic("rate_ctrl_status", 30);
add_topic("rate_ctrl_status", 200);
Copy link
Member

Choose a reason for hiding this comment

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

Can you add this with 30ms to add_high_rate_topics?

if (_selected_gyro != corrections.selected_gyro_instance) {
if (corrections.selected_gyro_instance < MAX_GYRO_COUNT) {
// clear all registered callbacks
for (auto sub : _sensor_gyro_sub) {
Copy link
Member

Choose a reason for hiding this comment

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

			for (auto& sub : _sensor_gyro_sub) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Ouch, fixed. #12662

Thanks @bkueng

@dagar
Copy link
Member Author

dagar commented Aug 8, 2019

I can see the reasoning, but I find it weird to run this from sensors:

  • it does not interact with that module, or share anything
  • and it even runs on a different process

Yes I agree it's a bit unusual and I originally had it as a standalone module (#12225). At the moment there's no scenario where you don't require both, so it started to feel like more of a liability. It's also going to get worse as more of these aggregators are added (vehicle_acceleration #12597 also now in master).

@dagar
Copy link
Member Author

dagar commented Aug 8, 2019

Can you add this with 30ms to add_high_rate_topics?

@bkueng rate_ctrl_status is already in add_high_rate_topics full rate. Do you want to limit it?

@bkueng
Copy link
Member

bkueng commented Aug 9, 2019

@bkueng rate_ctrl_status is already in add_high_rate_topics full rate. Do you want to limit it?

Sorry I missed that. It's fine then.

bkueng pushed a commit to PX4/flight_review that referenced this pull request Aug 16, 2019
bozkurthan pushed a commit to bozkurthan/Firmware that referenced this pull request Sep 4, 2019
 * split out filtered sensor_gyro aggregation from mc_att_control and move to wq:rate_ctrl
@jinwoolee6906
Copy link

I want to know the units of rollspeed, pitchspeed, and yawspeed inside the [rate_ctrl_status.msg] file. The results from the px4 review site are different from those from the matlab.

@bresch
Copy link
Member

bresch commented Jul 26, 2021

@jinwoolee6906 All the angles are in radians and all the angular rates are in rad/s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants