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

Fix mavlink header stamp in convert_to_rosmsg method #1852

Merged
merged 5 commits into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mavros/mavros/mavlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pymavlink import mavutil
from pymavlink.generator.mavcrc import x25crc # noqa F401
from std_msgs.msg import Header

from builtin_interfaces.msg import Time
from mavros_msgs.msg import Mavlink

from .utils import system_now
Expand Down Expand Up @@ -104,7 +104,9 @@ def convert_to_rosmsg(
if stamp is not None:
header = Header(stamp=stamp)
else:
header = Header(stamp=system_now())
stamp = Time()
stamp.sec, stamp.nanosec = system_now().seconds_nanoseconds()
header = Header(stamp=stamp)

if mavutil.mavlink20():
# XXX Need some api to retreive signature block.
Expand Down