-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* separate launch file for humble and jazzy * remove snapcraft.yaml from version control
- Loading branch information
Showing
7 changed files
with
127 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
squashfs-root/ | ||
*.snap | ||
exported.txt | ||
exported.txt | ||
**/snapcraft.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, GroupAction, OpaqueFunction | ||
from launch.substitutions import LaunchConfiguration | ||
from launch_ros.actions import Node, PushRosNamespace | ||
|
||
def get_frame_id(context): | ||
device_ns = LaunchConfiguration('device_namespace').perform(context) | ||
default_frame_id = LaunchConfiguration('frame_id').perform(context) | ||
return f"{device_ns}_link" if device_ns else f"{default_frame_id}" | ||
|
||
def generate_launch_description(): | ||
channel_type = LaunchConfiguration('channel_type', default='serial') | ||
serial_port = LaunchConfiguration('serial_port', default='/dev/ttyUSB0') | ||
serial_baudrate = LaunchConfiguration('serial_baudrate', default='256000') # for A3 is 256000 | ||
frame_id = LaunchConfiguration('frame_id', default='laser') | ||
inverted = LaunchConfiguration('inverted', default='false') | ||
angle_compensate = LaunchConfiguration('angle_compensate', default='true') | ||
scan_mode = LaunchConfiguration('scan_mode', default='') | ||
namespace = LaunchConfiguration('namespace', default='') | ||
device_namespace = LaunchConfiguration('device_namespace', default='') | ||
|
||
def launch_setup(context, *args, **kwargs): | ||
frame_id_value = get_frame_id(context) | ||
robot_ns = LaunchConfiguration('namespace').perform(context) | ||
|
||
remappings = [] | ||
if robot_ns: | ||
remappings.append(('/tf', f'/{robot_ns}/tf')) | ||
remappings.append(('/tf_static', f'/{robot_ns}/tf_static')) | ||
else: | ||
remappings.append(('/tf', '/tf')) | ||
remappings.append(('/tf_static', '/tf_static')) | ||
|
||
node = Node( | ||
package='rplidar_ros', | ||
executable='rplidar_composition', | ||
name='rplidar_node', | ||
parameters=[{ | ||
'channel_type': channel_type, | ||
'serial_port': serial_port, | ||
'serial_baudrate': serial_baudrate, | ||
'frame_id': frame_id_value, | ||
'inverted': inverted, | ||
'angle_compensate': angle_compensate, | ||
'scan_mode': scan_mode | ||
}], | ||
remappings=remappings, | ||
output='screen' | ||
) | ||
|
||
return [PushRosNamespace(namespace), PushRosNamespace(device_namespace), node] | ||
|
||
return LaunchDescription([ | ||
|
||
DeclareLaunchArgument( | ||
'channel_type', | ||
default_value=channel_type, | ||
description='Specifying channel type of lidar'), | ||
|
||
DeclareLaunchArgument( | ||
'serial_port', | ||
default_value=serial_port, | ||
description='Specifying usb port to connected lidar'), | ||
|
||
DeclareLaunchArgument( | ||
'serial_baudrate', | ||
default_value=serial_baudrate, | ||
description='Specifying usb port baudrate to connected lidar'), | ||
|
||
DeclareLaunchArgument( | ||
'frame_id', | ||
default_value=frame_id, | ||
description='Specifying frame_id of lidar'), | ||
|
||
DeclareLaunchArgument( | ||
'inverted', | ||
default_value=inverted, | ||
description='Specifying whether or not to invert scan data'), | ||
|
||
DeclareLaunchArgument( | ||
'angle_compensate', | ||
default_value=angle_compensate, | ||
description='Specifying whether or not to enable angle_compensate of scan data'), | ||
|
||
DeclareLaunchArgument( | ||
'scan_mode', | ||
default_value=scan_mode, | ||
description='Specifying scan mode of lidar'), | ||
|
||
DeclareLaunchArgument( | ||
'namespace', | ||
default_value='', | ||
description='Namespace which will appear in front of all topics (including /tf and /tf_static).', | ||
), | ||
|
||
DeclareLaunchArgument( | ||
'device_namespace', | ||
default_value='', | ||
description='Sensor namespace that will appear before all non absolute topics and TF frames, used for distinguishing multiple cameras on the same robot.', | ||
), | ||
|
||
OpaqueFunction(function=launch_setup) | ||
]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters