Skip to content

Commit

Permalink
Fix environment monitor node to not publish tf if monitoring another …
Browse files Browse the repository at this point in the history
…environment
  • Loading branch information
rjoomen authored and Levi-Armstrong committed Aug 21, 2023
1 parent f7147aa commit fc0fe2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tesseract_monitoring/src/environment_monitor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_monitoring/environment_monitor.h>

using namespace tesseract_environment;
using namespace tesseract_monitoring;

const std::string ROBOT_DESCRIPTION_PARAM = "robot_description"; /**< Default ROS parameter for robot description */
const std::string ROBOT_DESCRIPTION_SEMANTIC_PARAM = "robot_description_semantic";
Expand Down Expand Up @@ -48,10 +49,11 @@ int main(int argc, char** argv)
if (!monitored_namespace.empty())
monitor.startMonitoringEnvironment(monitored_namespace);

bool publish_tf = monitored_namespace.empty();
if (joint_state_topic.empty())
monitor.startStateMonitor();
monitor.startStateMonitor(DEFAULT_JOINT_STATES_TOPIC, publish_tf);
else
monitor.startStateMonitor(joint_state_topic);
monitor.startStateMonitor(joint_state_topic, publish_tf);

RCLCPP_INFO(node->get_logger(), "Environment Monitor Running!");

Expand Down

0 comments on commit fc0fe2c

Please sign in to comment.