Px4-autopilot: PX4, EKF Time Accuracy

Created on 3 Jul 2017  路  7Comments  路  Source: PX4/PX4-Autopilot

Hello,

  • Is there a particular reason why hrt_abstime (it's uint64_t) is measured in us and not ns ? If the accuracy on STM32 is at us level, we could just multiply and still use ns.
  • Integral_dt for gyro/accel are float32 and expressed in seconds, can we use int32_t and nanoseconds to avoid rounding off ? EKF accumulates timeslip because of this. ( see https://github.com/PX4/Firmware/blob/master/msg/sensor_combined.msg#L13 ) (@priseborough)
  • On POSIX, a mutex is acquired and released on every timestamping call but the mutex is only used in SITL, is it acceptable to enable it only on CONFIG_ARCH_BOARD_SITL ?

I'm willing to work and upstream this if you agree.

question state estimation

Most helpful comment

@mhkabir Indeed, timestamp is being used in a lot of modules which would need review

The implications are much bigger: the us timestamp is embedded in uorb, and this data is written to the logs, and then used by Flight Review, FlightPlot, etc.

All 7 comments

PX4 uses microseconds for everything because of the STM32 hardware it originated from, but do you really see an advantage of having nanosecond resolution for most flight control tasks? And in any case, transitioning the codebase from us to ns would be non-trivial because of the sheer size of the change.

Integral_dt for gyro/accel are float32 and expressed in seconds, can we use int32_t and nanoseconds to avoid rounding off.

This makes a lot of sense to me.

@priseborough Comments appreciated!

The error this rounding error introduces is negligible for a 1kHz sampling as it equates to less than 0.1% error which compared to our gyros which can have tup to 3% scale factor error, is insignificant. However if we start pushing sampling up to 4 or 8kHz to reduce aliasing effects, then it will become an issue because the effect of rounding error scales with sampling frequency.

@mhkabir Indeed, timestamp is being used in a lot of modules which would need review. As a first step, we could migrate the deltas from messages to ns. In any case, I don't expect it to be too hard because the timestamp is usually used for comparisons and for some modules which don't need ns accuracy, we could just scale down to micros.

@mhkabir Indeed, timestamp is being used in a lot of modules which would need review

The implications are much bigger: the us timestamp is embedded in uorb, and this data is written to the logs, and then used by Flight Review, FlightPlot, etc.

Agree with @bkueng. I do not think that it's a good idea to change the timestamps to ns at this point.

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 30 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:

[email protected]
Domain evercl.com has exceeded the max emails per hour (237/200 (118%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext7.iad.github.net ([192.30.252.198]:42019 helo=github-smtp2a-ext-cp1-prd.iad.github.net)
by apollo.graphium.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
(Exim 4.89_1)
(envelope-from noreply@github.com)
id 1eoU7D-0007qU-1h
for [email protected]; Wed, 21 Feb 2018 08:07:19 -0500
Date: Wed, 21 Feb 2018 05:04:28 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com;
s=pf2014; t=1519218268;
bh=iHWg43dQkIj5+pAZtami7vi+S50h161whCfnBX0uCWI=;
h=From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID:
List-Archive:List-Post:List-Unsubscribe:From;
b=2XfFr3KtRr8NnnclYxUIwEIjGbQpPlINLrcCzSB8UrCCQNFEehTuWGdkNPVzB/JXo
Vyas9939vf32LzQdTzz+2RxHofWgSFP13KdSzAOgTaHjcSp8pgv5o/OBXJc7mCC40d
cJitLM4DV+kWK5w4eTXpmOL5HEvrgxhTUuqxI7ck=
From: PX4 Build Bot notifications@github.com
Reply-To: PX4/Firmware reply@reply.github.com
To: PX4/Firmware Firmware@noreply.github.com
Cc: Subscribed subscribed@noreply.github.com
Message-ID:
In-Reply-To:
References:
Subject: Re: [PX4/Firmware] PX4, EKF Time Accuracy (#7519)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5a8d6e5c4ab55_29c3f7f996a4f341215e5";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: PX4BuildBot
X-GitHub-Recipient: evercltech
X-GitHub-Reason: subscribed
List-ID: PX4/Firmware
List-Archive: https://github.com/PX4/Firmware
List-Post: reply@reply.github.com
List-Unsubscribe: ,
https://github.com/notifications/unsubscribe/ACSImG9g8wQHRfT9E4f4nlUOjZyK6ODqks5tXBRcgaJpZM4OMf75
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: [email protected]

----==_mimepart_5a8d6e5c4ab55_29c3f7f996a4f341215e5
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #7519.

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/PX4/Firmware/issues/7519#event-1484606007
----==_mimepart_5a8d6e5c4ab55_29c3f7f996a4f341215e5
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #7519.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


----==_mimepart_5a8d6e5c4ab55_29c3f7f996a4f341215e5--

Was this page helpful?
0 / 5 - 0 ratings

Related issues

felix-west picture felix-west  路  4Comments

lgh5054 picture lgh5054  路  4Comments

prothen picture prothen  路  5Comments

alexcherpi picture alexcherpi  路  4Comments

zhanghouxin07 picture zhanghouxin07  路  5Comments