Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Const topic instead of parameters #2728

Merged
merged 6 commits into from
Jul 26, 2024
Merged
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 @@ -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
Loading