Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

#include <moveit/rdf_loader/synchronized_string_parameter.hpp>

#include <cctype>

namespace rdf_loader
{
std::string SynchronizedStringParameter::loadInitialValue(const std::shared_ptr<rclcpp::Node>& node,
Expand Down Expand Up @@ -120,7 +122,12 @@ bool SynchronizedStringParameter::shouldPublish()

bool SynchronizedStringParameter::waitForMessage(const rclcpp::Duration& timeout)
{
const auto nd_name = std::string(node_->get_name()).append("_ssp_").append(name_);
auto nd_name = std::string(node_->get_name()).append("_ssp_").append(name_);
for (char& character : nd_name)
{
if (!std::isalnum(static_cast<unsigned char>(character)) && character != '_')
character = '_';
}
const auto temp_node = std::make_shared<rclcpp::Node>(nd_name, node_->get_namespace());
string_subscriber_ = temp_node->create_subscription<std_msgs::msg::String>(
name_,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ class MOVEIT_PLANNING_SCENE_RVIZ_PLUGIN_CORE_EXPORT PlanningSceneDisplay : publi
void clearJobs();

const std::string getMoveGroupNS() const;
/// Return the robot description name resolved against the Move Group namespace.
/// Absolute names are returned unchanged.
const std::string getRobotDescription() const;
const moveit::core::RobotModelConstPtr& getRobotModel() const;

/// wait for robot state more recent than t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ const std::string PlanningSceneDisplay::getMoveGroupNS() const
return move_group_ns_property_->getStdString();
}

const std::string PlanningSceneDisplay::getRobotDescription() const
{
const std::string robot_description = robot_description_property_->getStdString();
if (getMoveGroupNS().empty() || robot_description.empty() || robot_description.front() == '/')
return robot_description;

return rclcpp::names::append(getMoveGroupNS(), robot_description);
}

const moveit::core::RobotModelConstPtr& PlanningSceneDisplay::getRobotModel() const
{
if (planning_scene_monitor_)
Expand Down Expand Up @@ -539,7 +548,7 @@ void PlanningSceneDisplay::unsetLinkColor(rviz_default_plugins::robot::Robot* ro
// ******************************************************************************************
planning_scene_monitor::PlanningSceneMonitorPtr PlanningSceneDisplay::createPlanningSceneMonitor()
{
auto rml = moveit::planning_interface::getSharedRobotModelLoader(node_, robot_description_property_->getStdString());
auto rml = moveit::planning_interface::getSharedRobotModelLoader(node_, getRobotDescription());
return std::make_shared<planning_scene_monitor::PlanningSceneMonitor>(node_, rml,
getNameStd() + "_planning_scene_monitor");
}
Expand Down