Skip to content

Commit 4f20204

Browse files
authored
Merge pull request #48 from juandpenan/main
Humble update compilation
2 parents 0cbee89 + 3d60f5e commit 4f20204

33 files changed

Lines changed: 194 additions & 159 deletions

bt_nodes/configuration/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<depend>behaviortree_cpp_v3</depend>
1717
<depend>geometry_msgs</depend>
1818
<depend>tf2_geometry_msgs</depend>
19+
<depend>yolov8_msgs</depend>
1920

2021
<test_depend>ament_lint_auto</test_depend>
2122
<test_depend>ament_lint_common</test_depend>

bt_nodes/hri/include/hri/check_policy.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class CheckPolicy
4747
return BT::PortsList(
4848
{BT::InputPort<std::string>("question"),
4949
BT::InputPort<std::string>("image_topic"),
50-
BT::OutputPort<bool>("output")});
50+
BT::OutputPort<bool>("output"),
51+
BT::OutputPort<std::string>("output_text")});
5152
}
5253

5354
private:

bt_nodes/hri/include/hri/dialog/store_detection.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,22 @@ class StoreDetection : public BT::ActionNodeBase
4343
BT::InputPort<std::string>("drink"),
4444
BT::InputPort<std::string>("guest_id"),
4545
BT::InputPort<std::int64_t>("guest_color_id"),
46+
BT::InputPort<std::string>("guest_description"),
4647

4748
BT::OutputPort<std::string>("name_1"),
4849
BT::OutputPort<std::string>("name_2"),
4950
BT::OutputPort<std::string>("drink_1"),
5051
BT::OutputPort<std::string>("drink_2"),
5152
BT::OutputPort<std::int64_t>("guest_color_id_1"),
52-
BT::OutputPort<std::int64_t>("guest_color_id_2")});
53+
BT::OutputPort<std::int64_t>("guest_color_id_2"),
54+
BT::OutputPort<std::string>("guest_description_id_1"),
55+
BT::OutputPort<std::string>("guest_description_id_2")});
5356
}
5457

5558
private:
5659
std::shared_ptr<rclcpp_cascade_lifecycle::CascadeLifecycleNode> node_;
5760

58-
std::string current_name_, current_drink_, name_1_, name_2_, drink_1_, drink_2_;
61+
std::string current_name_, current_drink_, name_1_, name_2_, drink_1_, drink_2_, current_description_;
5962
std::string current_id_ = "0";
6063
std::int64_t current_color_id_ = 0;
6164
};

bt_nodes/hri/src/hri/check_policy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ BT::NodeStatus CheckPolicy::on_success()
101101
return BT::NodeStatus::FAILURE;
102102
}
103103
std::string answer = result_.result->response.text;
104+
setOutput("output_text", answer);
104105

105106
answer.erase(
106107
std::remove_if(
@@ -121,7 +122,6 @@ BT::NodeStatus CheckPolicy::on_success()
121122
RCLCPP_ERROR(node_->get_logger(), "Not a valid answer: %s", answer.c_str());
122123
return BT::NodeStatus::FAILURE;
123124
}
124-
125125
setOutput("output", value_);
126126
return BT::NodeStatus::SUCCESS;
127127
}

bt_nodes/hri/src/hri/dialog/DialogConfirmation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ void DialogConfirmation::on_tick()
5454

5555
BT::NodeStatus DialogConfirmation::on_success()
5656
{
57-
fprintf(stderr, "%s\n", result_.result->text.c_str());
57+
fprintf(stderr, "%s\n", result_.result->transcription.text.c_str());
5858

59-
if (result_.result->text.size() == 0) {
59+
if (result_.result->transcription.text.size() == 0) {
6060
return BT::NodeStatus::FAILURE;
6161
}
6262

6363
std::transform(
64-
result_.result->text.begin(), result_.result->text.end(), result_.result->text.begin(),
64+
result_.result->transcription.text.begin(), result_.result->transcription.text.end(), result_.result->transcription.text.begin(),
6565
[](unsigned char c) {return std::tolower(c);});
66-
if (result_.result->text.find("yes") != std::string::npos) {
66+
if (result_.result->transcription.text.find("yes") != std::string::npos) {
6767
return BT::NodeStatus::SUCCESS;
6868
} else {
6969
return BT::NodeStatus::FAILURE;

bt_nodes/hri/src/hri/dialog/Listen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ void Listen::on_tick()
5151

5252
BT::NodeStatus Listen::on_success()
5353
{
54-
fprintf(stderr, "%s\n", result_.result->text.c_str());
54+
fprintf(stderr, "%s\n", result_.result->transcription.text.c_str());
5555

56-
if (result_.result->text.size() == 0) {
56+
if (result_.result->transcription.text.size() == 0) {
5757
return BT::NodeStatus::FAILURE;
5858
}
5959

60-
setOutput("listen_text", result_.result->text);
60+
setOutput("listen_text", result_.result->transcription.text);
6161
return BT::NodeStatus::SUCCESS;
6262
}
6363

bt_nodes/hri/src/hri/dialog/store_detection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ BT::NodeStatus StoreDetection::tick()
3737
getInput("drink", current_drink_);
3838
getInput("guest_id", current_id_);
3939
getInput("guest_color_id", current_color_id_);
40+
getInput("guest_description", current_description_);
4041

4142
if (current_name_.empty() || current_drink_.empty()) {
4243
return BT::NodeStatus::FAILURE;
@@ -48,13 +49,15 @@ BT::NodeStatus StoreDetection::tick()
4849
setOutput("name_1", name_1_);
4950
setOutput("drink_1", drink_1_);
5051
setOutput("guest_color_id_1", current_color_id_);
52+
setOutput("guest_description_id_1", current_description_);
5153
return BT::NodeStatus::SUCCESS;
5254
} else if (current_id_ == "2") {
5355
name_2_ = current_name_;
5456
drink_2_ = current_drink_;
5557
setOutput("name_2", name_2_);
5658
setOutput("drink_2", drink_2_);
5759
setOutput("guest_color_id_2", current_color_id_);
60+
setOutput("guest_description_id_2", current_description_);
5861
return BT::NodeStatus::SUCCESS;
5962
}
6063
return BT::NodeStatus::SUCCESS;

bt_nodes/perception/src/perception/IsDetected.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ IsDetected::IsDetected(const std::string & xml_tag_name, const BT::NodeConfigura
7272
bb_img_pub_ = node_->create_publisher<sensor_msgs::msg::Image>(
7373
"/bb_img_best_detection", 10);
7474
img_sub_ = node_->create_subscription<sensor_msgs::msg::Image>(
75-
"/camera/color/image_raw", 10,
75+
"/head_front_camera/rgb/image_raw", 10,
7676
std::bind(&IsDetected::image_callback, this, _1));
7777
} else {
7878
bb_img_pub_ = nullptr;
@@ -243,8 +243,8 @@ BT::NodeStatus IsDetected::tick()
243243
// cv::circle(last_image_, center2d, 5, cv::Scalar(0, 0, 255), -1);
244244

245245
cv::putText(
246-
last_image_, "X", center2d, cv::FONT_HERSHEY_SIMPLEX, 1,
247-
cv::Scalar(0, 0, 255), 2);
246+
last_image_, "[X]", center2d, cv::FONT_HERSHEY_SIMPLEX, 1.0,
247+
cv::Scalar(0, 0, 0), 1);
248248

249249
auto msg = cv_bridge::CvImage(std_msgs::msg::Header(), "bgr8", last_image_).toImageMsg();
250250
bb_img_pub_->publish(*msg);

bt_nodes/perception/src/perception/filter_object.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,43 @@ FilterObject::FilterObject(
3636
objects_({{"person", {"human", 170.0f, 70.0f}},
3737
{"bag", {"accessory", 30.0f, 0.3f}},
3838
{"soccer_ball", {"toy", 28.0f, 0.4f}},
39+
{"washcloth", {"cleaning_supply", 28.0f, 0.01f}},
3940
{"bottle", {"drink", 27.0f, 1.0f}},
41+
{"big_coke", {"drink", 27.0f, 2.0f}},
4042
{"red_wine", {"drink", 26.0f, 1.0f}},
4143
{"pringles", {"snack", 25.0f, 0.5f}},
4244
{"orange_juice", {"drink", 24.0f, 0.5f}},
4345
{"tropical_juice", {"drink", 24.0f, 0.5f}},
4446
{"cleanser", {"cleaning_supply", 23.0f, 0.75f}},
45-
{"cornflakes", {"snack", 22.0f, 0.4f}},
47+
{"soap", {"cleaning_supply", 23.0f, 0.75f}},
48+
{"cornflakes", {"food", 22.0f, 0.4f}},
49+
{"pancake_mix", {"food", 20.0f, 0.3f}},
50+
{"hagelslag", {"food", 15.0f, 0.3f}},
4651
{"plate", {"dish", 21.0f, 0.5f}},
4752
{"bowl", {"dish", 20.0f, 0.5f}},
4853
{"banana", {"fruit", 19.0f, 0.25f}},
4954
{"tomato_soup", {"food", 18.0f, 0.5f}},
50-
{"iced_tea", {"drink", 17.0f, 0.5f}},
55+
{"iced_tea", {"drink", 12.0f, 0.5f}},
5156
{"juice_pack", {"drink", 12.0f, 0.4f}},
52-
{"cola", {"drink", 11.0f, 0.5f}},
53-
{"sponge", {"cleaning_supply", 11.0f, 0.1f}},
57+
{"cola", {"drink", 12.0f, 0.5f}},
58+
{"fanta", {"drink", 12.0f, 0.5f}},
59+
{"dubbelfris", {"drink", 11.0f, 0.6f}},
60+
{"sponge", {"cleaning_supply", 11.0f, 0.01f}},
61+
{"tictac", {"snack", 10.0f, 0.4f}},
5462
{"7up", {"drink", 11.0f, 0.5f}},
5563
{"mustard", {"food", 11.0f, 0.3f}},
56-
{"milk", {"drink", 10.0f, 1.0f}},
57-
{"water", {"drink", 10.0f, 1.0f}},
64+
{"curry", {"food", 12.0f, 0.7f}},
65+
{"mayonaise", {"food", 12.0f, 0.7f}},
66+
{"pea_soup", {"food", 14.0f, 1.0f}},
67+
{"sausages", {"food", 14.0f, 1.0f}},
68+
{"milk", {"drink", 14.0f, 0.7f}},
69+
{"stroopwafel", {"snack", 15.0f, 0.8f}},
70+
{"candy", {"snack", 14.0f, 0.5f}},
71+
{"water", {"drink", 13.0f, 0.6f}},
5872
{"apple", {"fruit", 9.0f, 0.2f}},
5973
{"cheezit", {"snack", 9.0f, 0.1f}},
74+
{"liquorice", {"snack", 9.0f, 0.1f}},
75+
{"crisps", {"snack", 9.0f, 0.1f}},
6076
{"orange", {"fruit", 9.0f, 0.25f}},
6177
{"pear", {"fruit", 9.0f, 0.25f}},
6278
{"peach", {"fruit", 9.0f, 0.2f}},
@@ -78,6 +94,7 @@ FilterObject::FilterObject(
7894
{"spoon", {"dish", 4.0f, 0.1f}},
7995
{"strawberry", {"fruit", 3.0f, 0.05f}},
8096
{"dice", {"toy", 2.0f, 0.05f}},
97+
{"candle", {"decoration", 1.0f, 0.02f}},
8198
{"dishwasher_tab", {"cleaning_supply", 1.0f, 0.02f}}})
8299
{
83100
config().blackboard->get("node", node_);

cs4home_simple_project/CMakeLists.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)