Skip to content

Commit c4fae06

Browse files
authored
Merge pull request #45 from igonzf/deploy
Updated parameters
2 parents 9256e7c + e06944f commit c4fae06

13 files changed

Lines changed: 50 additions & 37 deletions

File tree

bt_nodes/perception/include/perception/IsDetected.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class IsDetected : public BT::ConditionNode
6767
}
6868

6969
private:
70-
void image_callback(const sensor_msg::msg::Image::SharedPtr msg);
70+
void image_callback(const sensor_msgs::msg::Image::SharedPtr msg);
7171
std::shared_ptr<rclcpp_cascade_lifecycle::CascadeLifecycleNode> node_;
7272
std::shared_ptr<tf2_ros::Buffer> tf_buffer_;
7373

@@ -89,8 +89,8 @@ class IsDetected : public BT::ConditionNode
8989
std::map<int, std::string> pose_names_;
9090

9191
bool pub_bb_img_{false};
92-
rclcpp::Publisher<sensor_msg::msg::Image>::SharedPtr bb_img_pub_;
93-
rclcpp::Subscription<sensor_msg::msg::Image>::SharedPtr img_sub_;
92+
rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr bb_img_pub_;
93+
rclcpp::Subscription<sensor_msgs::msg::Image>::SharedPtr img_sub_;
9494

9595
cv::Mat last_image_;
9696
};

bt_nodes/perception/src/perception/IsDetected.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ IsDetected::IsDetected(const std::string & xml_tag_name, const BT::NodeConfigura
6969
getInput("pub_bb_img", pub_bb_img_);
7070

7171
if (pub_bb_img_) {
72-
pub_bb_img_ = node_->create_publisher<sensor_msgs::msg::Image>(
72+
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>(
7575
"/camera/color/image_raw", 10,
7676
std::bind(&IsDetected::image_callback, this, _1));
7777
} else {
78-
pub_bb_img_ = nullptr;
78+
bb_img_pub_ = nullptr;
7979
img_sub_ = nullptr;
8080
}
8181

@@ -233,9 +233,6 @@ BT::NodeStatus IsDetected::tick()
233233
RCLCPP_INFO(node_->get_logger(), "[IsDetected] %d detections after filter", frames_.size());
234234
}
235235

236-
237-
238-
// pub->publish(detections[0].image);
239236

240237
setOutput("best_detection", detections[0].class_name);
241238

@@ -250,7 +247,7 @@ BT::NodeStatus IsDetected::tick()
250247
cv::Scalar(0, 0, 255), 2);
251248

252249
auto msg = cv_bridge::CvImage(std_msgs::msg::Header(), "bgr8", last_image_).toImageMsg();
253-
pub_bb_img_->publish(*msg);
250+
bb_img_pub_->publish(*msg);
254251
}
255252

256253
RCLCPP_DEBUG(node_->get_logger(), "[IsDetected] Detections sorted");
@@ -269,13 +266,14 @@ void IsDetected::image_callback(const sensor_msgs::msg::Image::SharedPtr msg)
269266
{
270267
cv_bridge::CvImagePtr image_rgb_ptr;
271268
try {
272-
image_rgb_ptr = cv_bridge::toCvCopy(msg->source_img, sensor_msgs::image_encodings::BGR8);
269+
image_rgb_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
273270
} catch (cv_bridge::Exception & e) {
274-
RCLCPP_ERROR(get_logger(), "cv_bridge exception: %s", e.what());
271+
RCLCPP_ERROR(node_->get_logger(), "cv_bridge exception: %s", e.what());
275272
return;
276273
}
277274
last_image_ = image_rgb_ptr->image;
278275

276+
}
279277
} // namespace perception
280278

281279
BT_REGISTER_NODES(factory) {

robocup_bringup/bt_xml/carry_my_luggage.xml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
frame_name="initial"
1111
initial_pose="{going_back}"
1212
x_offset="0.0"
13-
y_offset="2.0"
13+
y_offset="0.0"
1414
/>
1515

1616

@@ -32,23 +32,22 @@
3232
<Action ID="Speak" param="{bag_direction}" say_text="I see you are pointing to the bag at my"/>
3333
<Action ID="Speak" param="" say_text="I am on my way"/>
3434
<Action ID="MoveTo" is_truncated="true" distance_tolerance="1.2" tf_frame="{bag_tf}"/>
35-
<Action ID="MoveToPredefined" pose="offer" group_name="arm_torso"/>
36-
<Action ID="Speak" param="" say_text="please put the bag in my gripper"/>
35+
<Action ID="MoveToPredefined" pose="offer" group_name="arm_torso"/>
36+
<Action ID="Speak" param="" say_text="please put the bag in my gripper"/>
3737
<Delay delay_msec="140">
3838
<Action ID="MoveToPredefined" pose="open" group_name="gripper"/>
3939
</Delay>
4040
<ReactiveSequence>
41-
4241
<RetryUntilSuccessful num_attempts="-1">
4342
<Condition ID="IsDetected" cam_frame="head_front_camera_rgb_optical_frame" confidence="0.6" frames="{frames}" interest="person" max_depth="5" max_entities="1" order="depth"/>
4443
</RetryUntilSuccessful>
4544
<Action ID="FilterEntity" frame="person_0" lambda="0.1"/>
4645
<Action ID="LookAt" tf_frame="person_0_filtered" />
4746
</ReactiveSequence>
48-
<Delay delay_msec="140">
47+
<Delay delay_msec="300">
4948
<Action ID="MoveToPredefined" pose="close" group_name="gripper"/>
5049
</Delay>
51-
<Delay delay_msec="300">
50+
<Delay delay_msec="500">
5251
<Action ID="MoveToPredefined" pose="home" group_name="arm_torso"/>
5352
</Delay>
5453
<Action ID="Speak" param="" say_text="Perfect, now i will follow you. Please stop at the end "/>
@@ -60,7 +59,13 @@
6059
<Fallback>
6160
<ReactiveSequence>
6261
<RetryUntilSuccessful num_attempts="-1">
63-
<Condition ID="IsDetected" cam_frame="head_front_camera_rgb_optical_frame" confidence="0.3" person_id="{person_id}" interest="person" max_depth="6.7" max_entities="1" order="color"/>
62+
<Condition ID="IsDetected" cam_frame="head_front_camera_rgb_optical_frame"
63+
confidence="0.6"
64+
person_id="{person_id}"
65+
interest="person"
66+
max_depth="3.0"
67+
max_entities="2"
68+
order="color"/>
6469
</RetryUntilSuccessful>
6570
<Action ID="FilterEntity" frame="person_0" lambda="0.1"/>
6671
<Action ID="LookAt" tf_frame="person_0_filtered"/>
@@ -69,7 +74,6 @@
6974
robot_distance_to_person="1.0"
7075
frame="person_0_filtered"
7176
check_time="9.0"/>
72-
<!-- <Condition ID="IsMoving" frame="person_0" position_buffer_dimension="50" threshold_time="4.0" velocity_tolerance="0.003"/> -->
7377
<Action ID="FollowEntity" camera_frame="head_front_camera_rgb_optical_frame"
7478
distance_tolerance="0.2"
7579
frame_to_follow="person_0_filtered"

robocup_bringup/bt_xml/gpsr.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<BehaviorTree ID="GPSR">
33
<Sequence>
44
<Action ID="SetupGPSR" plugins="{plugins}"/>
5-
<SetBlackboard output_key="cam_frame" value="head_front_camera_color_optical_frame"/>
5+
<SetBlackboard output_key="cam_frame" value="head_front_camera_link_color_optical_frame"/>
66
<!-- <Action ID="SetStartPosition" frame_name="instruction point" /> -->
77
<Action ID="SetWp"/>
88

robocup_bringup/bt_xml/receptionist.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
order="color"
275275
best_detection="{best_detection}"
276276
/>
277-
<Action ID="MoveAlongAxis" speed="0.5" distance="6.28" axis="z"/>
277+
<Action ID="MoveAlongAxis" speed="-0.5" distance="6.28" axis="z"/>
278278
</ReactiveFallback>
279279
<Action ID="LookAt" tf_frame="{best_detection}"/>
280280

robocup_bringup/bt_xml/robot_inspection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<RetryUntilSuccessful num_attempts="-1">
1010
<Condition ID="IsDoorOpen" door_thfloatreshold="1.5"/>
1111
</RetryUntilSuccessful>
12-
<Action ID="MoveAlongAxis" speed="0.25" distance="1.8" axis="x"/>
12+
<Action ID="MoveAlongAxis" speed="0.25" distance="0.8" axis="x"/>
1313

1414
<Action ID="MoveTo" is_truncated="false" distance_tolerance="0" tf_frame="inspection_zone"/>
1515
<Action ID="Speak" param="" say_text="Please say ready when you finish the inspection"/>

robocup_bringup/bt_xml/storing_groceries.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
<Action ID="InitGroceries"/>
99
<Action ID="Speak" say_text="Hi this is gentlebots. Can you please open the door "/>
1010

11-
<!-- <RetryUntilSuccessful num_attempts="-1">
11+
<RetryUntilSuccessful num_attempts="-1">
1212
<Condition ID="IsDoorOpen" door_thfloatreshold="1.5"/>
13-
</RetryUntilSuccessful> -->
13+
</RetryUntilSuccessful>
14+
15+
<Action ID="MoveAlongAxis" speed="0.25" distance="1.0" axis="x"/>
16+
1417
<Repeat num_cycles="5">
1518
<Sequence>
1619
<Action ID="MoveTo" distance_tolerance="1" tf_frame="table"/>
1720
<Action ID="MoveJoint" joint_name="torso_lift_joint"
18-
joint_value="0.23"
21+
joint_value="0.3"
1922
group_name="arm_torso"/>
2023
<RetryUntilSuccessful num_attempts="-1">
2124

@@ -33,15 +36,18 @@
3336
max_depth="5"
3437
max_entities="1"
3538
order="depth"
36-
best_detection="{best_detection}"/>
39+
best_detection="{best_detection}"
40+
pub_bb_img="true"/>
3741

3842
<Action ID="RemoveStringSuffix" string_to_remove="{best_detection}"
3943
suffix="_"
4044
result="{possible_pick}"/>
4145
</Sequence>
4246
</RetryUntilSuccessful>
47+
4348
<Action ID="ClearOctomap" />
4449
<Action ID="Speak" say_text="I am detecting " param="{possible_pick}"/>
50+
<Action ID="Speak" say_text="as you can see it on my chest"/>
4551
<Action ID="Speak" say_text="Trying to pick it from the table "/>
4652
<RetryUntilSuccessful num_attempts="-1">
4753
<Sequence>

robocup_bringup/config/gpsr/gpsr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
behaviors_main:
22
ros__parameters:
33
use_sim_time: False
4-
cam_frame: "head_front_camera_color_optical_frame"
4+
cam_frame: "head_front_camera_link_color_optical_frame"
55
home_position: [54.701, 1.360, 0.001]
66
home_pose: "home"
77
offer_pose: "offer"

robocup_bringup/config/inspection/tiago_nav_params.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ local_costmap:
223223
inflation_layer:
224224
plugin: "nav2_costmap_2d::InflationLayer"
225225
cost_scaling_factor: 3.0
226-
inflation_radius: 0.55
226+
inflation_radius: 0.40
227227
voxel_layer:
228228
plugin: "nav2_costmap_2d::VoxelLayer"
229229
enabled: True
@@ -278,7 +278,7 @@ global_costmap:
278278
robot_radius: 0.29
279279
resolution: 0.05
280280
track_unknown_space: true
281-
plugins: ["static_layer", "inflation_layer"]
281+
plugins: ["static_layer","obstacle_layer", "inflation_layer"]
282282
obstacle_layer:
283283
plugin: "nav2_costmap_2d::ObstacleLayer"
284284
enabled: True

robocup_bringup/config/receptionist/receptionist_params.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
offer_pose: "offer"
88
person_id: 001122334455
99
waypoints_names: ["entrance", "party", "guest_confirmation"]
10-
# allow_duplicate_names: false
10+
# ARENA C:
1111
waypoints: # [x, y, yaw] only 3 numbers!!
12-
entrance: [-2.065, -2.304, 1.174]
13-
party: [-2.725, -3.593, -2.210]
14-
guest_confirmation: [-2.725, -3.593, 0.482]
12+
entrance: [10.552, -8.863, -2.737]
13+
party: [15.103, -8.220, -0.446]
14+
guest_confirmation: [15.103, -8.220, -1.949]
1515

1616
behaviors_main:
1717
ros__parameters:

0 commit comments

Comments
 (0)