Skip to content

Commit

Permalink
Update src/modules/simulation/gz_bridge/GZBridge.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Dahl <[email protected]>
  • Loading branch information
Claudio-Chies and dakejahl authored Nov 5, 2024
1 parent ef72892 commit c099567
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/simulation/gz_bridge/GZBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,12 @@ void GZBridge::laserScantoLidarSensorCallback(const gz::msgs::LaserScan &scan)

distance_sensor_s distance_sensor{};
distance_sensor.timestamp = hrt_absolute_time();
distance_sensor.device_id = 0;
device::Device::DeviceId id;
id.devid_s.bus_type = device::Device::DeviceBusType::DeviceBusType_SIMULATION;
id.devid_s.bus = 0;
id.devid_s.address = 0;
id.devid_s.devtype = DRV_DIST_DEVTYPE_SIM;
distance_sensor.device_id = id.devid;
distance_sensor.min_distance = static_cast<float>(scan.range_min());
distance_sensor.max_distance = static_cast<float>(scan.range_max());
distance_sensor.current_distance = static_cast<float>(scan.ranges()[0]);
Expand Down

0 comments on commit c099567

Please sign in to comment.