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

[WIP] Timestamps - Add timestamp chaining through timestamp_sample #8827

Closed
wants to merge 1 commit into from

Conversation

bresch
Copy link
Member

@bresch bresch commented Feb 5, 2018

The timestamp_sample field has been used to propagate the timestamp of a measurement through the actuator_controls topic. I completed the chain to have this working though the VTOL code in order to estimate the dead-time this module adds and being able to get the complete computation time at each loop.
Here is the result of a run on a PixHawk Pro autopilot from Drotek:
delays

sensor_combined -> 0.75ms -> vehicle_attitude -> 0.25ms -> actuator_controls_virtual -> 3.25ms -> actuator_controls -> 0.5ms -> actuator_outputs

The total delay - from sensors_combined to actuator_outputs is approximately 4.75ms. Which makes a maximum loop frequency of ~211Hz... not 250.

@dagar Not sure if you would like to merge this, but at least you have the results here.

@bresch bresch requested a review from dagar February 5, 2018 12:23
@dagar
Copy link
Member

dagar commented Feb 5, 2018

Thanks! At a minimum I'll do some testing across a range of different configurations and then we'll see if it's worth having this in all the time. My only hesitation is increasing the message size for something that we aren't regularly going to be looking at.

@dagar dagar changed the title Timestamps - Add timestamp chaining through timestamp_sample [WIP] Timestamps - Add timestamp chaining through timestamp_sample Feb 5, 2018
@dagar
Copy link
Member

dagar commented Feb 5, 2018

Added [WIP] to block merging.

@@ -1340,6 +1340,15 @@ PX4FMU::cycle()

actuator_outputs_s actuator_outputs = {};
actuator_outputs.timestamp = hrt_absolute_time();

for (unsigned i = 0; i < actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS; i++) {
actuator_outputs.timestamp_sample = _controls[i].timestamp_sample;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this. There are other actuator_controls publications in the system that might be throwing this off. https://github.com/PX4/Firmware/blob/master/src/modules/fw_att_control/fw_att_control_main.cpp#L1233

For now only using actuator_controls_0 should be sufficient if in the VTOL case you always put the timestamp_sample coming from the active controller.

@dagar
Copy link
Member

dagar commented Feb 5, 2018

@bresch out of curiosity did you try in both MC and FW VTOL modes?

@bresch
Copy link
Member Author

bresch commented Feb 5, 2018

@dagar Only MC and it was disarmed.

@dagar dagar force-pushed the pr-timestamp-sample-sensor branch from 6262132 to 273975c Compare April 17, 2018 19:27
@dagar
Copy link
Member

dagar commented Apr 30, 2018

Continued in #9388 (partially).

@dagar dagar closed this Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants