Skip to content

Commit

Permalink
Use parent node options (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund authored Nov 14, 2023
1 parent 60413ca commit 8356d14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
1 change: 1 addition & 0 deletions nexus_motion_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set (motion_planner_server_dependencies
)

set (test_request_dependencies
moveit_msgs
nexus_endpoints
geometry_msgs
rclcpp
Expand Down
2 changes: 1 addition & 1 deletion nexus_motion_planner/launch/demo_planner_server.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def launch_setup(context, *args, **kwargs):
executable="static_transform_publisher",
name="motion_planner_static_transform_publisher_base_link_t_item",
output="log",
arguments=["0.3", "0.2", "0.1", "0.0", "0.0", "0.0", "base_link", "item"],
arguments=["0.6", "0.2", "0.5", "3.14", "0.0", "3.14", "base_link", "item"],
condition=IfCondition(publish_item),
)

Expand Down
33 changes: 3 additions & 30 deletions nexus_motion_planner/src/motion_planner_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@ MotionPlannerServer::MotionPlannerServer(const rclcpp::NodeOptions& options)
{
RCLCPP_INFO(this->get_logger(), "Motion Planner Server is running...");

auto internal_node_options = rclcpp::NodeOptions();
internal_node_options.automatically_declare_parameters_from_overrides(true);
internal_node_options.use_global_arguments(false);
_internal_node = std::make_shared<rclcpp::Node>(
"motion_planner_server_internal_node", internal_node_options);
"motion_planner_server_internal_node", options);
_spin_thread = std::thread(
[this]()
[node = _internal_node]()
{
while (rclcpp::ok())
{
rclcpp::spin_some(_internal_node);
rclcpp::spin_some(node);
}
});

Expand Down Expand Up @@ -70,30 +67,6 @@ MotionPlannerServer::MotionPlannerServer(const rclcpp::NodeOptions& options)
this->declare_parameter("default_group_name", "manipulator");
_group_names.insert({name, std::move(group_name)});

const std::string description_param_name = _use_namespace ?
name + ".robot_description" : "robot_description";
const auto description_param =
this->declare_parameter(
description_param_name,
rclcpp::ParameterType::PARAMETER_STRING);

// Push robot_description parameter to internal node
_internal_node->declare_parameter(
description_param_name,
description_param);

const std::string description_semantic_param_name = _use_namespace ?
name + ".robot_description_semantic" : "robot_description_semantic";
const auto description_semantic_param =
this->declare_parameter(
description_semantic_param_name,
rclcpp::ParameterType::PARAMETER_STRING);

// Push robot_description_semantic parameter to internal node
_internal_node->declare_parameter(
description_semantic_param_name,
description_semantic_param);

}
RCLCPP_INFO(
this->get_logger(),
Expand Down

0 comments on commit 8356d14

Please sign in to comment.