Skip to content

Commit fbcc9a4

Browse files
committed
parse guest description
1 parent 6597129 commit fbcc9a4

4 files changed

Lines changed: 41 additions & 5 deletions

File tree

bt_nodes/arm/CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ find_package(tf2_ros REQUIRED)
1616
find_package(geometry_msgs REQUIRED)
1717
find_package(sensor_msgs REQUIRED)
1818
find_package(play_motion2_msgs REQUIRED)
19-
# uncomment the following section in order to fill in
19+
find_package(Eigen3 REQUIRED)
20+
find_package(srdfdom REQUIRED)
21+
find_package(eigen_stl_containers REQUIRED)
22+
find_package(geometric_shapes REQUIRED)
23+
find_package(moveit_core REQUIRED)
24+
find_package(tf2_geometry_msgs REQUIRED)
25+
include_directories(${EIGEN3_INCLUDE_DIRS})
2026
# further dependencies manually.
2127
# find_package(<dependency> REQUIRED)
2228

@@ -32,8 +38,15 @@ set(dependencies
3238
geometry_msgs
3339
sensor_msgs
3440
play_motion2_msgs
41+
srdfdom
42+
eigen_stl_containers
43+
geometric_shapes
44+
moveit_core
45+
tf2_geometry_msgs
46+
Eigen3
3547
)
3648

49+
3750
include_directories(include)
3851

3952
add_library(pick_bt_node SHARED src/manipulation/pick_object.cpp)

bt_nodes/hri/src/hri/dialog/get_guest_info.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ void GetGuestInfo::on_result()
9797
std_msgs::msg::String fact_msg;
9898

9999
// Delete attending fact
100-
fact_msg.data = "robot1 oro:attends " + guest_id_;
101-
kb_publisher_->publish(fact_msg);
100+
if (!guest_id_.empty()) {
101+
fact_msg.data = "robot1 oro:attends " + guest_id_;
102+
kb_publisher_->publish(fact_msg);
103+
}
102104

103105
setStatus(BT::NodeStatus::SUCCESS);
104106
}

bt_nodes/hri/src/hri/dialog/store_guest_info.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ std::string obtain_guest_id(const std::string & json)
7575
return "guest" + std::to_string(max_id + 1);
7676
}
7777

78+
static std::string escape_turtle_literal(std::string s)
79+
{
80+
// 1) Escape backslashes
81+
for (size_t pos = 0; (pos = s.find('\\', pos)) != std::string::npos; pos += 2) {
82+
s.replace(pos, 1, "\\\\");
83+
}
84+
85+
// 2) Escape double quotes
86+
for (size_t pos = 0; (pos = s.find('"', pos)) != std::string::npos; pos += 2) {
87+
s.replace(pos, 1, "\\\"");
88+
}
89+
90+
// 3) Optional: normalize newlines (depends on parser strictness)
91+
for (size_t pos = 0; (pos = s.find('\n', pos)) != std::string::npos; pos += 2) {
92+
s.replace(pos, 1, "\\n");
93+
}
94+
95+
return s;
96+
}
97+
7898
void StoreGuestInfo::on_result()
7999
{
80100
RCLCPP_DEBUG(node_->get_logger(), "[StoreGuestInfo] result received");
@@ -101,6 +121,7 @@ void StoreGuestInfo::on_result()
101121
kb_publisher_->publish(fact_msg);
102122

103123
if (!guest_description_.empty()) {
124+
guest_description_ = escape_turtle_literal(guest_description_);
104125
fact_msg.data = guest_id + " oro:description \"" + guest_description_ + "\"";
105126
kb_publisher_->publish(fact_msg);
106127
}

robocup_bringup/launch/receptionist_dependencies.launch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def generate_launch_description():
4141

4242
manipulation_server = IncludeLaunchDescription(
4343
PythonLaunchDescriptionSource(
44-
os.path.join(manipulation_dir, 'launch', 'server.launch.py')
44+
os.path.join(manipulation_dir, 'launch', 'simple_server.launch.py')
4545
)
4646
)
4747

@@ -97,6 +97,6 @@ def generate_launch_description():
9797
ld.add_action(yolo3d)
9898
ld.add_action(real_time)
9999
#ld.add_action(move_group)
100-
#ld.add_action(manipulation_server)
100+
ld.add_action(manipulation_server)
101101

102102
return ld

0 commit comments

Comments
 (0)