Skip to content

Commit

Permalink
Added real robot launch file
Browse files Browse the repository at this point in the history
  • Loading branch information
VincidaB committed Jan 17, 2024
1 parent 2b67309 commit af68c43
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions src/ezbot_descr_simul/launch/real_robot.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# copyright option3 ensma
import os

from ament_index_python.packages import get_package_share_directory


from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument
import launch_ros.actions
from launch.substitutions import LaunchConfiguration
from launch.launch_description_sources import PythonLaunchDescriptionSource

from launch_ros.actions import Node



def generate_launch_description():


# Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled
# !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!!

package_name='ezbot_descr_simul' #<--- CHANGE ME

rsp = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory(package_name),'launch','rsp.launch.py'
)]), launch_arguments={'use_sim_time': 'true'}.items()
)

# Include the Gazebo launch file, provided by the gazebo_ros package
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]),
launch_arguments={'verbose': 'true'}.items()
)

# Run the spawner node from the gazebo_ros package. The entity name doesn't really matter if you only have a single robot.
spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
arguments=['-topic', 'robot_description',
'-entity', 'EzBot',
'-x','1.0',
'-y','-1.0',
'-z', '1.0' ],
output='screen')

joystick = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory("teleop_twist_joy"),'launch','teleop-launch.py'
)]), launch_arguments={'config_filepath': '/home/vincent/joystick.yaml'}.items())


# Launch them all!
return LaunchDescription([
DeclareLaunchArgument(
'world',
#default_value=[os.path.join('ezbot_gazebo','worlds','table2024.world'), ''],
default_value=[os.path.join(get_package_share_directory("ezbot_gazebo"), 'worlds', 'table2024Poteaux.world'), ''],
description='SDF world file'),
rsp,
gazebo,
spawn_entity,
joystick
])

0 comments on commit af68c43

Please sign in to comment.