diff --git a/snp_application/config/snp.xml b/snp_application/config/snp.xml index b91add900..9be2ea0aa 100644 --- a/snp_application/config/snp.xml +++ b/snp_application/config/snp.xml @@ -31,13 +31,13 @@ input="{approach}" output="{updated_approach}"/> @@ -156,17 +156,17 @@ input="{approach}" output="{updated_approach}"/> diff --git a/snp_application/src/snp_widget.cpp b/snp_application/src/snp_widget.cpp index b3b0d66f9..69b4058c4 100644 --- a/snp_application/src/snp_widget.cpp +++ b/snp_application/src/snp_widget.cpp @@ -23,6 +23,7 @@ static const std::string BT_FILES_PARAM = "bt_files"; static const std::string BT_PARAM = "tree"; static const std::string BT_SHORT_TIMEOUT_PARAM = "bt_short_timeout"; static const std::string BT_LONG_TIMEOUT_PARAM = "bt_long_timeout"; +static const std::string FOLLOW_JOINT_TRAJECTORY_ACTION = "follow_joint_trajectory_action"; class TPPDialog : public QDialog { @@ -110,6 +111,7 @@ SNPWidget::SNPWidget(rclcpp::Node::SharedPtr rviz_node, QWidget* parent) bt_node_->declare_parameter(BT_PARAM, ""); bt_node_->declare_parameter(BT_SHORT_TIMEOUT_PARAM, 5); // seconds bt_node_->declare_parameter(BT_LONG_TIMEOUT_PARAM, 6000); // seconds + bt_node_->declare_parameter(FOLLOW_JOINT_TRAJECTORY_ACTION, "follow_joint_trajectory"); bt_node_->declare_parameter(IR_TSDF_VOXEL_PARAM, 0.01f); bt_node_->declare_parameter(IR_TSDF_SDF_PARAM, 0.03f); @@ -162,6 +164,10 @@ BT::BehaviorTreeFactory SNPWidget::createBTFactory(int ros_short_timeout, int ro ros_params.wait_for_server_timeout = std::chrono::seconds(0); ros_params.server_timeout = std::chrono::seconds(ros_short_timeout); + // Get joint trajectory action topic name from parameter and store it in the blackboard + board_->set(FOLLOW_JOINT_TRAJECTORY_ACTION, + snp_application::get_parameter(bt_node_, FOLLOW_JOINT_TRAJECTORY_ACTION)); + // Publishers/Subscribers bt_factory.registerNodeType("ToolPathsPub", ros_params); bt_factory.registerNodeType("MotionPlanPub", ros_params);