-
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.
- Loading branch information
Showing
10 changed files
with
355 additions
and
51 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
urg_node: | ||
ros__parameters: | ||
angle_max: 3.14 | ||
angle_min: -3.14 | ||
ip_address: "192.168.0.10" | ||
ip_port: 10940 | ||
serial_baud: 115200 | ||
laser_frame_id: "base_laser" | ||
calibrate_time: false | ||
default_user_latency: 0.0 | ||
diagnostics_tolerance: 0.05 | ||
diagnostics_window_time: 5.0 | ||
error_limit: 4 | ||
get_detailed_status: false | ||
publish_intensity: false | ||
publish_multiecho: false | ||
cluster: 1 | ||
skip: 0 |
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,98 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from launch.actions import ( | ||
OpaqueFunction, | ||
DeclareLaunchArgument, | ||
TimerAction, | ||
IncludeLaunchDescription, | ||
) | ||
from launch.substitutions import ( | ||
Command, | ||
FindExecutable, | ||
LaunchConfiguration, | ||
PathJoinSubstitution, | ||
) | ||
from ament_index_python.packages import get_package_share_directory | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.conditions import IfCondition, UnlessCondition | ||
|
||
|
||
def launch_setup(context, *args, **kwargs): | ||
# Configure some helper variables and paths | ||
pkg_c300_navigation = get_package_share_directory("c300_navigation") | ||
pkg_driver = get_package_share_directory("c300_driver") | ||
pkg_robot_description = get_package_share_directory("c300_description") | ||
pkg_bringup = get_package_share_directory("c300_bringup") | ||
|
||
# Hardware LIDAR | ||
lidar_launch_py = PythonLaunchDescriptionSource( | ||
[ | ||
pkg_bringup, | ||
"/launch/urg_node_launch.py", | ||
] | ||
) | ||
lidar_launch = IncludeLaunchDescription( | ||
lidar_launch_py, | ||
) | ||
|
||
# Hardware Driver | ||
driver_launch_py = PythonLaunchDescriptionSource( | ||
[ | ||
pkg_driver, | ||
"/launch/driver.launch.py", | ||
] | ||
) | ||
driver_launch = IncludeLaunchDescription( | ||
driver_launch_py, | ||
) | ||
|
||
# Parse xacro and publish robot state | ||
robot_description_path = os.path.join( | ||
pkg_robot_description, "urdf", "c300_base.urdf" | ||
) | ||
|
||
robot_description_content = Command( | ||
[ | ||
PathJoinSubstitution([FindExecutable(name="xacro")]), | ||
" ", | ||
robot_description_path, | ||
" ", | ||
] | ||
) | ||
robot_description = {"robot_description": robot_description_content} | ||
|
||
robot_state_publisher_node = Node( | ||
package="robot_state_publisher", | ||
executable="robot_state_publisher", | ||
name="c300_robot_state_publisher", | ||
output="both", | ||
parameters=[robot_description, {"publish_frequency", "50"}], | ||
) | ||
|
||
# Bringup Navigation2 | ||
nav2_launch_py = PythonLaunchDescriptionSource( | ||
[ | ||
pkg_c300_navigation, | ||
"/launch/navigation.launch.py", | ||
] | ||
) | ||
nav2_launch = IncludeLaunchDescription( | ||
nav2_launch_py, | ||
) | ||
|
||
nodes_and_launches = [ | ||
robot_state_publisher_node, | ||
lidar_launch, | ||
driver_launch, | ||
TimerAction(period=5.0, actions=[nav2_launch]), | ||
] | ||
|
||
return nodes_and_launches | ||
|
||
|
||
def generate_launch_description(): | ||
return LaunchDescription( | ||
[OpaqueFunction(function=launch_setup)] | ||
) |
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,39 @@ | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.actions import OpaqueFunction | ||
from launch.actions import SetLaunchConfiguration | ||
from launch.substitutions import LaunchConfiguration | ||
|
||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
config_dir = get_package_share_directory('c300_bringup') | ||
launch_description = LaunchDescription([ | ||
DeclareLaunchArgument( | ||
'sensor_interface', | ||
default_value='ethernet', | ||
description='sensor_interface: supported: serial, ethernet')]) | ||
|
||
def expand_param_file_name(context): | ||
param_file = os.path.join( | ||
config_dir, 'config', | ||
'urg_node_' + context.launch_configurations['sensor_interface'] + '.yaml') | ||
if os.path.exists(param_file): | ||
return [SetLaunchConfiguration('param', param_file)] | ||
|
||
param_file_path = OpaqueFunction(function=expand_param_file_name) | ||
launch_description.add_action(param_file_path) | ||
|
||
hokuyo_node = Node( | ||
package='urg_node', executable='urg_node_driver', output='screen', | ||
name='urg_node', | ||
parameters=[LaunchConfiguration('param')] | ||
) | ||
|
||
launch_description.add_action(hokuyo_node) | ||
return launch_description |
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,23 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
import launch | ||
import launch_ros.actions | ||
|
||
|
||
def generate_launch_description(): | ||
return launch.LaunchDescription( | ||
[ | ||
launch_ros.actions.Node( | ||
package="c300_driver", | ||
executable="twist2roboclaw", | ||
name="driver", | ||
remappings={ | ||
("c3pzero/cmd_vel", "/cmd_vel"), | ||
("/c3pzero/odometry", "/odom") | ||
}, | ||
), | ||
] | ||
) |
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
Oops, something went wrong.