Skip to content

Commit 399e36b

Browse files
authored
Improve Module 3 exercise (#40)
* have wrong param definition for both declare and get otherwise we get a misleading error Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com> * change the intentional typo ftom sub to pub to improve exercise flow Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com> --------- Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
1 parent dd72fec commit 399e36b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

modules/module_3/src/laser_detector_node.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ namespace module_3 {
2121
LaserDetectorNode::LaserDetectorNode(const rclcpp::NodeOptions& options)
2222
: rclcpp::Node("laser_detector_node", options) {
2323
// Declare parameters
24-
this->declare_parameter("fotprint_radius", 1.0);
25-
this->declare_parameter("min_points", 20);
24+
this->declare_parameter("footprint_radius", 1.0);
25+
this->declare_parameter("min_point", 20);
2626
this->declare_parameter("roi_min_angle", 0.0);
2727
this->declare_parameter("roi_max_angle", 2.0 * M_PI);
2828

@@ -48,11 +48,11 @@ LaserDetectorNode::LaserDetectorNode(const rclcpp::NodeOptions& options)
4848
}
4949

5050
// Publishers
51-
obstacle_pub_ = this->create_publisher<std_msgs::msg::Bool>("obstacle_detection", 10);
51+
obstacle_pub_ = this->create_publisher<std_msgs::msg::Bool>("obstacle_detections", 10);
5252

5353
// Subscribers
5454
scan_sub_ = this->create_subscription<sensor_msgs::msg::LaserScan>(
55-
"scans", rclcpp::SensorDataQoS(),
55+
"scan", rclcpp::SensorDataQoS(),
5656
std::bind(&LaserDetectorNode::scan_callback, this, std::placeholders::_1));
5757

5858
RCLCPP_INFO(this->get_logger(), "LaserDetectorNode initialized");

0 commit comments

Comments
 (0)