Skip to content

Commit

Permalink
robot state display: subscribe on enable / unsubscribe on disable
Browse files Browse the repository at this point in the history
The display didn't connect in onEnable.
It only did after the user changed the topic name.

Also, disconnect onDisable. There's no need to keep listening to the topic
until the display is enabled again.
  • Loading branch information
v4hn committed Mar 1, 2017
1 parent 81b94da commit de0e55d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,15 @@ void RobotStateDisplay::onEnable()
robot_->setVisible(true);
}
calculateOffsetPosition();
changedRobotStateTopic();
}

// ******************************************************************************************
// Disable
// ******************************************************************************************
void RobotStateDisplay::onDisable()
{
robot_state_subscriber_.shutdown();
if (robot_)
robot_->setVisible(false);
Display::onDisable();
Expand Down

0 comments on commit de0e55d

Please sign in to comment.