Skip to content

Commit

Permalink
FIX: gcc warnings (false positives?)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Aug 25, 2024
1 parent 50fd929 commit 5b42d5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libs/ros1bridge/src/point_cloud2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ bool mrpt::ros1bridge::fromROS(
{
const unsigned char* msg_data = row_data + col * msg.point_step;

float x, y, z;
float x = 0, y = 0, z = 0;
uint16_t ring_id = 0;
get_float_from_field(x_field, msg_data, x);
get_float_from_field(y_field, msg_data, y);
Expand Down Expand Up @@ -589,7 +589,7 @@ bool mrpt::ros1bridge::fromROS(

if (i_field)
{
float intensity;
float intensity = 0;
get_float_from_field(i_field, msg_data, intensity);
obj.intensityImage(ring_id, az_idx) = lround(255 * intensity / max_intensity);
}
Expand Down
6 changes: 3 additions & 3 deletions libs/ros2bridge/src/point_cloud2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ bool mrpt::ros2bridge::fromROS(const sensor_msgs::msg::PointCloud2& msg, CPoints
}
if (t_field)
{
double t;
double t = 0;
get_double_from_field(t_field, msg_data, t);

// If the sensor uses absolute timestamp, convert them to relative
Expand Down Expand Up @@ -546,7 +546,7 @@ bool mrpt::ros2bridge::fromROS(
{
const unsigned char* msg_data = row_data + col * msg.point_step;

float x, y, z;
float x = 0, y = 0, z = 0;
uint16_t ring_id = 0;
get_float_from_field(x_field, msg_data, x);
get_float_from_field(y_field, msg_data, y);
Expand Down Expand Up @@ -575,7 +575,7 @@ bool mrpt::ros2bridge::fromROS(

if (i_field)
{
float intensity;
float intensity = 0;
get_float_from_field(i_field, msg_data, intensity);
obj.intensityImage(ring_id, az_idx) = lround(255 * intensity / max_intensity);
}
Expand Down

0 comments on commit 5b42d5a

Please sign in to comment.