Skip to content

Commit

Permalink
Const topic instead of parameters (#2728)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shobuj-Paul authored Jul 26, 2024
1 parent c6163bf commit 51c3862
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,28 @@ class MoveItCpp
/// Specification of options to use when constructing the MoveItCpp class
struct PlanningSceneMonitorOptions
{
PlanningSceneMonitorOptions()
: joint_state_topic(planning_scene_monitor::PlanningSceneMonitor::DEFAULT_JOINT_STATES_TOPIC)
, attached_collision_object_topic(
planning_scene_monitor::PlanningSceneMonitor::DEFAULT_ATTACHED_COLLISION_OBJECT_TOPIC)
, monitored_planning_scene_topic(planning_scene_monitor::PlanningSceneMonitor::MONITORED_PLANNING_SCENE_TOPIC)
, publish_planning_scene_topic(planning_scene_monitor::PlanningSceneMonitor::DEFAULT_PLANNING_SCENE_TOPIC)
{
}

void load(const rclcpp::Node::SharedPtr& node)
{
const std::string ns = "planning_scene_monitor_options";
node->get_parameter_or(ns + ".name", name, std::string("planning_scene_monitor"));
node->get_parameter_or(ns + ".robot_description", robot_description, std::string("robot_description"));
node->get_parameter_or(ns + ".joint_state_topic", joint_state_topic,
planning_scene_monitor::PlanningSceneMonitor::DEFAULT_JOINT_STATES_TOPIC);
node->get_parameter_or(ns + ".attached_collision_object_topic", attached_collision_object_topic,
planning_scene_monitor::PlanningSceneMonitor::DEFAULT_ATTACHED_COLLISION_OBJECT_TOPIC);
node->get_parameter_or(ns + ".monitored_planning_scene_topic", monitored_planning_scene_topic,
planning_scene_monitor::PlanningSceneMonitor::MONITORED_PLANNING_SCENE_TOPIC);
node->get_parameter_or(ns + ".publish_planning_scene_topic", publish_planning_scene_topic,
planning_scene_monitor::PlanningSceneMonitor::DEFAULT_PLANNING_SCENE_TOPIC);
node->get_parameter_or(ns + ".wait_for_initial_state_timeout", wait_for_initial_state_timeout, 0.0);
}
std::string name;
std::string robot_description;
std::string joint_state_topic;
std::string attached_collision_object_topic;
std::string monitored_planning_scene_topic;
std::string publish_planning_scene_topic;
const std::string joint_state_topic;
const std::string attached_collision_object_topic;
const std::string monitored_planning_scene_topic;
const std::string publish_planning_scene_topic;
double wait_for_initial_state_timeout;
};

Expand Down

0 comments on commit 51c3862

Please sign in to comment.