-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
4861499
commit 9007814
Showing
6 changed files
with
171 additions
and
1 deletion.
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
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,115 @@ | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch.conditions import IfCondition | ||
from launch.actions import DeclareLaunchArgument, GroupAction | ||
from launch.substitutions import LaunchConfiguration | ||
from launch_ros.actions import Node, PushRosNamespace | ||
from launch_ros.descriptions import ParameterFile | ||
from nav2_common.launch import RewrittenYaml | ||
|
||
|
||
def generate_launch_description(): | ||
# Get the package directory | ||
bringup_dir = get_package_share_directory("pb2025_nav_bringup") | ||
|
||
# Create the launch configuration variables | ||
namespace = LaunchConfiguration("namespace") | ||
use_namespace = LaunchConfiguration("use_namespace") | ||
joy_vel = LaunchConfiguration("joy_vel") | ||
joy_dev = LaunchConfiguration("joy_dev") | ||
joy_config_file = LaunchConfiguration("joy_config_file") | ||
publish_stamped_twist = LaunchConfiguration("publish_stamped_twist") | ||
|
||
configured_params = ParameterFile( | ||
RewrittenYaml( | ||
source_file=joy_config_file, | ||
root_key=namespace, | ||
param_rewrites={}, | ||
convert_types=True), | ||
allow_substs=True) | ||
|
||
# Declare the launch arguments | ||
declare_namespace_cmd = DeclareLaunchArgument( | ||
"namespace", | ||
default_value="", | ||
description="Top-level namespace", | ||
) | ||
|
||
declare_use_namespace_cmd = DeclareLaunchArgument( | ||
"use_namespace", | ||
default_value="false", | ||
description="Whether to apply a namespace to the navigation stack", | ||
) | ||
|
||
declare_joy_vel_cmd = DeclareLaunchArgument( | ||
"joy_vel", | ||
default_value="cmd_vel", | ||
description="The topic to publish velocity commands to", | ||
) | ||
|
||
declare_joy_config_file_cmd = DeclareLaunchArgument( | ||
"joy_config_file", | ||
default_value=os.path.join(bringup_dir, "config", "simulation", "nav2_params.yaml"), | ||
description="The joystick configuration file path", | ||
) | ||
|
||
declare_joy_dev_cmd = DeclareLaunchArgument( | ||
"joy_dev", default_value="0", description="The joystick device ID" | ||
) | ||
|
||
declare_publish_stamped_twist_cmd = DeclareLaunchArgument( | ||
"publish_stamped_twist", | ||
default_value="false", | ||
description="Whether to publish stamped twist messages", | ||
) | ||
|
||
bringup_cmd_group = GroupAction( | ||
[ | ||
PushRosNamespace(condition=IfCondition(use_namespace), namespace=namespace), | ||
Node( | ||
package="joy", | ||
executable="joy_node", | ||
name="joy_node", | ||
output="screen", | ||
parameters=[ | ||
{ | ||
"device_id": joy_dev, | ||
"deadzone": 0.3, | ||
"autorepeat_rate": 20.0, | ||
} | ||
], | ||
), | ||
Node( | ||
package="teleop_twist_joy", | ||
executable="teleop_node", | ||
name="teleop_twist_joy_node", | ||
output="screen", | ||
parameters=[ | ||
configured_params, | ||
{ | ||
"publish_stamped_twist": publish_stamped_twist, | ||
}, | ||
], | ||
remappings=[("/cmd_vel", joy_vel)], | ||
), | ||
] | ||
) | ||
|
||
# Create the launch description and populate | ||
ld = LaunchDescription() | ||
|
||
# Declare the launch options | ||
ld.add_action(declare_namespace_cmd) | ||
ld.add_action(declare_use_namespace_cmd) | ||
ld.add_action(declare_joy_vel_cmd) | ||
ld.add_action(declare_joy_config_file_cmd) | ||
ld.add_action(declare_joy_dev_cmd) | ||
ld.add_action(declare_publish_stamped_twist_cmd) | ||
|
||
# Add the actions to launch the nodes | ||
ld.add_action(bringup_cmd_group) | ||
|
||
return ld |
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
Submodule small_gicp_relocalization
updated
2 files
+0 −1 | package.xml | |
+0 −7 | src/small_gicp_relocalization.cpp |