Skip to content

Commit

Permalink
fix(tier4_vehicle_rviz_plugin): initialization vehicle rviz plugin (#…
Browse files Browse the repository at this point in the history
…1379) (#109)

fix(tier4_vehicle_rviz_plugin): initialization vehicle rivz plugin (#1379)

* fix(tier4_vehicle_rviz_plugin): initialization vehicle rviz plugin

Signed-off-by: Takeshi Miura <m.takeshi1995@gmail.com>

* initialize signal_type

Signed-off-by: Takeshi Miura <m.takeshi1995@gmail.com>

Signed-off-by: Takeshi Miura <m.takeshi1995@gmail.com>
Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com>
  • Loading branch information
tkimura4 and 1222-takeshi committed Sep 6, 2022
1 parent 7ffc17b commit 157f5d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions common/tier4_vehicle_rviz_plugin/src/tools/console_meter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ void ConsoleMeterDisplay::update(float wall_dt, float ros_dt)
double linear_x = 0;
{
std::lock_guard<std::mutex> message_lock(mutex_);
if (!last_msg_ptr_) {
return;
if (last_msg_ptr_) {
linear_x = last_msg_ptr_->longitudinal_velocity;
}
linear_x = last_msg_ptr_->longitudinal_velocity;
}

QColor background_color;
Expand Down
5 changes: 2 additions & 3 deletions common/tier4_vehicle_rviz_plugin/src/tools/steering_angle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ void SteeringAngleDisplay::update(float wall_dt, float ros_dt)
double steering = 0;
{
std::lock_guard<std::mutex> message_lock(mutex_);
if (!last_msg_ptr_) {
return;
if (last_msg_ptr_) {
steering = last_msg_ptr_->steering_tire_angle;
}
steering = last_msg_ptr_->steering_tire_angle;
}

QColor background_color;
Expand Down
7 changes: 3 additions & 4 deletions common/tier4_vehicle_rviz_plugin/src/tools/turn_signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ void TurnSignalDisplay::update(float wall_dt, float ros_dt)
(void)wall_dt;
(void)ros_dt;

unsigned int signal_type;
unsigned int signal_type = 0;
{
std::lock_guard<std::mutex> message_lock(mutex_);
if (!last_msg_ptr_) {
return;
if (last_msg_ptr_) {
signal_type = last_msg_ptr_->report;
}
signal_type = last_msg_ptr_->report;
}

QColor background_color;
Expand Down

0 comments on commit 157f5d3

Please sign in to comment.