Skip to content

Commit

Permalink
fixed rangefinder simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Aug 3, 2024
1 parent 780d1ee commit cecc21c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uav_system_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void UavSystemRos::publishRangefinder(const MultirotorModel::State &state) {
double range_measurement;

if (body_z(2) > 0) {
range_measurement = (state.x(2) - model_params_.ground_z) / cos(tilt) + 0.10;
range_measurement = (state.x(2) - model_params_.ground_z) / cos(tilt);
} else {
range_measurement = std::numeric_limits<double>::max();
}
Expand All @@ -423,7 +423,7 @@ void UavSystemRos::publishRangefinder(const MultirotorModel::State &state) {
range.header.frame_id = _frame_rangefinder_;
range.header.stamp = ros::Time::now();
range.max_range = 40.0;
range.min_range = 0.05;
range.min_range = 0.0;
range.range = range_measurement;
range.radiation_type = range.INFRARED;
range.field_of_view = 0.01;
Expand Down

0 comments on commit cecc21c

Please sign in to comment.