Files
ros-raspbot-v2/raspbot_v2/src/raspbot_v2_sim/launch/rviz2.launch.py
T
m5p3nc3r ec554bcf2c Migrate to a new physical robot
Uses the mecanum controller properly across physical and virtual
There is a timing issue with i2c which is why the control update is limited to 10hz
The sonar and LED's arent yet working, this will come soon.
2026-05-27 13:25:20 +00:00

49 lines
1.5 KiB
Python

import os
from ament_index_python import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, RegisterEventHandler, TimerAction
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
def generate_launch_description():
namespace = LaunchConfiguration('namespace')
declared_args = [
DeclareLaunchArgument(
'namespace', default_value='',
description='ROS namespace for all robot nodes (e.g. "robot1").'
),
]
rviz_config_dir = os.path.join(
get_package_share_directory('raspbot_v2_sim'),
'rviz', 'raspbot_v2.rviz')
bringup_robot = IncludeLaunchDescription(
PythonLaunchDescriptionSource([
PathJoinSubstitution([
FindPackageShare('raspbot_v2_bringup'), 'launch', 'raspbot_v2_bringup.launch.py'
])
]),
launch_arguments={
'namespace': namespace,
'use_sim_time': 'false',
}.items()
)
return LaunchDescription([
*declared_args,
bringup_robot,
Node(
package="rviz2",
executable="rviz2",
name="rviz2",
arguments=['-d', rviz_config_dir],
output='screen',
)
])