Skip to content

Commit 71b4dd1

Browse files
authored
Merge pull request #18 from convince-project/fix/service_introspection
added service introspection
2 parents dc01aa4 + 35d47ee commit 71b4dd1

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

template_skill/include/TemplateSkill.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/*HALT*/#include <bt_interfaces_dummy/srv/halt_$skillTypeLC$.hpp>/*END_HALT*/
1717
/*DATAMODEL*/
1818
#include "$skillName$SkillDataModel.h" /*END_DATAMODEL*/
19+
#include <rcl/service_introspection.h>
1920

2021
#define SERVICE_TIMEOUT 8
2122
#define SKILL_SUCCESS 0

template_skill/src/TemplateSkill.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,15 @@ bool $className$::start(int argc, char*argv[])
7272
std::bind(&$className$::tick,
7373
this,
7474
std::placeholders::_1,
75-
std::placeholders::_2));/*END_TICK*/
75+
std::placeholders::_2));
76+
m_tickService->configure_introspection(m_node->get_clock(), rclcpp::SystemDefaultsQoS(), RCL_SERVICE_INTROSPECTION_CONTENTS);/*END_TICK*/
7677
/*HALT*/
7778
m_haltService = m_node->create_service<bt_interfaces_dummy::srv::Halt$skillType$>(m_name + "Skill/halt",
7879
std::bind(&$className$::halt,
7980
this,
8081
std::placeholders::_1,
81-
std::placeholders::_2));/*END_HALT*/
82+
std::placeholders::_2));
83+
m_haltService->configure_introspection(m_node->get_clock(), rclcpp::SystemDefaultsQoS(), RCL_SERVICE_INTROSPECTION_CONTENTS);/*END_HALT*/
8284
/*ACTION_LIST_C*//*ACTION_C*/
8385
m_actionClient = rclcpp_action::create_client<$eventData.interfaceName$::action::$eventData.functionName$>(m_node, "/$eventData.componentName$/$eventData.functionName$");
8486
m_send_goal_options.goal_response_callback = std::bind(&$className$::goal_response_callback, this, std::placeholders::_1);
@@ -94,6 +96,7 @@ bool $className$::start(int argc, char*argv[])
9496
std::shared_ptr<rclcpp::Node> $eventData.nodeName$ = rclcpp::Node::make_shared(m_name + "SkillNode$eventData.functionName$");
9597
std::shared_ptr<rclcpp::Client<$eventData.interfaceName$::srv::$eventData.serviceTypeName$>> $eventData.clientName$ = $eventData.nodeName$->create_client<$eventData.interfaceName$::srv::$eventData.serviceTypeName$>($eventData.serverName$);
9698
auto request = std::make_shared<$eventData.interfaceName$::srv::$eventData.serviceTypeName$::Request>();
99+
$eventData.clientName$->configure_introspection($eventData.nodeName$->get_clock(), rclcpp::SystemDefaultsQoS(), RCL_SERVICE_INTROSPECTION_CONTENTS);
97100
auto eventParams = event.data().toMap();
98101
/*PARAM_LIST*//*PARAM*/
99102
request->$IT->FIRST$ = convert<decltype(request->$IT->FIRST$)>(eventParams["$IT->FIRST$"].toString().toStdString());/*END_PARAM*/

0 commit comments

Comments
 (0)