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

AP_DDS: Publish all available GPS instances #29419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tizianofiorenzani
Copy link
Contributor

@tizianofiorenzani tizianofiorenzani commented Mar 3, 2025

Allow all GPS instances to be published on the /ap/navsat topic. All instances are published, each with their instance represented in the header.frame_id field.

This approach follows what has been already implemented for the /ap/battery topic.

Test

Simulation parameters need to be updated in order to enable a second GPS instance to be found.

  • GPS2_TYPE = 1
  • SIM_GPS2_ENABLE = 1
  • Restart the simulator and micro-ros.
  • On another terminal, publish the topic with: ros2 topic echo /ap/navsat
---
header:
  stamp:
    sec: 1741022473
    nanosec: 424456000
  frame_id: '0'
status:
  status: 2
  service: 1
latitude: -35.36326217651367
longitude: 149.1652374267578
altitude: 584.0899658203125
position_covariance:
- 0.09000000357627869
- 0.0
- 0.0
- 0.0
- 0.09000000357627869
- 0.0
- 0.0
- 0.0
- 0.09000000357627869
position_covariance_type: 2
---
header:
  stamp:
    sec: 1741022473
    nanosec: 424456000
  frame_id: '1'
status:
  status: 2
  service: 1
latitude: -35.36326217651367
longitude: 149.1652374267578
altitude: 584.0899658203125
position_covariance:
- 0.09000000357627869
- 0.0
- 0.0
- 0.0
- 0.09000000357627869
- 0.0
- 0.0
- 0.0
- 0.09000000357627869
position_covariance_type: 2
---

@@ -209,7 +209,6 @@ bool AP_DDS_Client::update_topic(sensor_msgs_msg_NavSatFix& msg, const uint8_t i

auto &gps = AP::gps();
WITH_SEMAPHORE(gps.get_semaphore());

if (!gps.is_healthy(instance)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the GPS goes unhealthy, we still need to publish it. Existing problem.

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.

4 participants