Skip to content

Commit

Permalink
renamed everything to the /lidar namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
VincidaB committed May 9, 2024
1 parent 8e8ff80 commit e01ebc3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def generate_launch_description():
declare_node_name_cmd = DeclareLaunchArgument(
'node_name',
default_value='ldlidar_node',
namespace='lidar',
description='Name of the node'
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def generate_launch_description():
package='nav2_lifecycle_manager',
executable='lifecycle_manager',
name='lidar_lifecycle_manager',
namespace='lidar',
output='screen',
parameters=[
# YAML files
Expand Down
5 changes: 3 additions & 2 deletions src/listen_package/listen_package/ecoute.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self):
qos_profile = rclpy.qos.QoSProfile(depth=10, reliability=rclpy.qos.QoSReliabilityPolicy.BEST_EFFORT)
self.subscription = self.create_subscription(
LaserScan,
'ldlidar_node/scan',
'/lidar/ldlidar_node/scan',
self.listener_callback,
qos_profile)
self.subscription # prevent unused variable warning
Expand All @@ -25,8 +25,9 @@ def listener_callback(self, msg):
# Check if any of the range values are within the specified distance
for range_value in msg.ranges:
if min_distance < range_value < max_distance:

# If an object is detected within the specified range, publish a message
self.get_logger().info("Object detected")
self.get_logger().info("Object detected at distance : %f" % range_value)
self.publisher.publish(String(data='Object detected'))
break

Expand Down

0 comments on commit e01ebc3

Please sign in to comment.