Skip to content

Commit

Permalink
added new files
Browse files Browse the repository at this point in the history
  • Loading branch information
HazorTremz committed Dec 10, 2023
1 parent 6f5b8b0 commit ed1e053
Show file tree
Hide file tree
Showing 13 changed files with 404 additions and 122 deletions.
70 changes: 70 additions & 0 deletions ebot_description/launch/start_world_launch_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-

'''
*****************************************************************************************
*
* =============================================
* TBD Theme (eYRC 2023-24)
* =============================================
*
*
* Filename: start_world_launch.py
* Description: Use this file to launch e-yantra warehouse world in gazebo simulator
* Created: 12/07/2023
* Last Modified: 12/07/2023
* Modified by: Amit
* Author: e-Yantra Team
*
*****************************************************************************************
'''


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 IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
from ament_index_python.packages import get_package_prefix

pkg_name='eyantra_warehouse'

def generate_launch_description():

pkg_gazebo_ros = get_package_share_directory('gazebo_ros')
pkg_models_dir = get_package_share_directory(pkg_name)

install_dir = get_package_prefix(pkg_name)

if 'GAZEBO_MODEL_PATH' in os.environ:
gazebo_models_path = os.path.join(pkg_models_dir, 'models')
os.environ['GAZEBO_MODEL_PATH'] = gazebo_models_path
else:
os.environ['GAZEBO_MODEL_PATH'] = install_dir + "/share"

if 'GAZEBO_PLUGIN_PATH' in os.environ:
os.environ['GAZEBO_PLUGIN_PATH'] = os.environ['GAZEBO_PLUGIN_PATH'] + ':' + install_dir + '/lib'
else:
os.environ['GAZEBO_PLUGIN_PATH'] = install_dir + '/lib'

# Gazebo launch
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py'),
)
)

return LaunchDescription([
DeclareLaunchArgument(
'world',
default_value=[os.path.join(pkg_models_dir, 'worlds', 'eyantra_warehouse_task3.world'), ''], # Change name of world file if required.
description='SDF world file'),
gazebo
# ExecuteProcess(cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_factory.so'], output='screen'),
])
94 changes: 94 additions & 0 deletions eyantra_warehouse/launch/task3a.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-

'''
*****************************************************************************************
*
* =============================================
* TBD Theme (eYRC 2023-24)
* =============================================
*
*
* Filename: ebot_display_launch.py
* Description: Use this file to spawn ebot inside e-yantra warehouse world in the gazebo simulator and publish robot states.
* Created: 16/07/2023
* Last Modified: 16/07/2023
* Modified by: Archit, Jaison
* Author: e-Yantra Team
*
*****************************************************************************************
'''

import launch
import launch_ros
import os
import xacro
from ament_index_python.packages import get_package_share_directory
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource

def get_package_file(package, file_path):
"""Get the location of a file installed in an ament package"""
package_path = get_package_share_directory(package)
absolute_file_path = os.path.join(package_path, file_path)
return absolute_file_path

def generate_launch_description():
pkg_share = launch_ros.substitutions.FindPackageShare(package='ebot_description').find('ebot_description')

xacro_file_ebot = os.path.join(pkg_share, 'models/','ebot/', 'ebot_description.xacro')
assert os.path.exists(xacro_file_ebot), "The box_bot.xacro doesnt exist in "+str(xacro_file_ebot)
robot_description_config_ebot = xacro.process_file(xacro_file_ebot)
robot_description_ebot = robot_description_config_ebot.toxml()


start_world = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ebot_description'), 'launch', 'start_world_launch_3.py'),
)
)

robot_state_publisher_node_ebot = launch_ros.actions.Node(
package='robot_state_publisher',
name='ebot_RD',
executable='robot_state_publisher',
parameters=[{"robot_description": robot_description_ebot}],
remappings=[('robot_description', 'robot_description_ebot')]

)

static_transform = launch_ros.actions.Node(
package='tf2_ros',
executable='static_transform_publisher',
name='static_transform_publisher',
arguments = ["1.6", "-2.4", "-0.8", "3.14", "0", "0", "world", "odom"],
output='screen')

spawn_ebot = launch_ros.actions.Node(
package='gazebo_ros',
name='ebot_spawner',
executable='spawn_entity.py',
# arguments=['-entity', 'ebot', '-topic', 'robot_description_ebot', '-x', '1.1', '-y', '4.35', '-z', '0.1', '-Y', '3.14'],
arguments=['-entity', 'ebot', '-topic', 'robot_description_ebot', '-x', '0.0', '-y', '0.0', '-z', '0.1', '-Y', '0.0'],
output='screen'
)

spawn_arm = launch_ros.actions.Node(
package='gazebo_ros',
name='ur5_spawner',
executable='spawn_entity.py',
arguments=['-entity', 'ur5', '-topic', 'robot_description_ur5', '-x', '1.6', '-y', '-2.4', '-z', '0.58', '-Y', '3.14'],
output='screen')


return launch.LaunchDescription([
launch.actions.DeclareLaunchArgument(name='gui', default_value='True',
description='Flag to enable joint_state_publisher_gui'),
launch.actions.DeclareLaunchArgument(name='use_sim_time', default_value='True',
description='Flag to enable use_sim_time'),
start_world,
robot_state_publisher_node_ebot,
spawn_ebot,
static_transform,
spawn_arm
])
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<model>
<name>table</name>
<name>drop_table</name>
<version>1.0</version>
<sdf version="1.7">model.sdf</sdf>
<author>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0'?>
<sdf version='1.7'>
<model name='table'>
<model name='drop_table'>
<link name='link'>
<inertial>
<mass>1</mass>
Expand All @@ -23,7 +23,7 @@
<cast_shadows>0</cast_shadows>
<geometry>
<mesh>
<uri>model://table/meshes/table.dae</uri>
<uri>model://drop_table/meshes/table.dae</uri>
</mesh>
</geometry>
<material>
Expand Down
11 changes: 0 additions & 11 deletions eyantra_warehouse/models/table_box/model.config

This file was deleted.

104 changes: 0 additions & 104 deletions eyantra_warehouse/models/table_box/model.sdf

This file was deleted.

4 changes: 2 additions & 2 deletions eyantra_warehouse/worlds/eyantra_warehouse_task2a.world
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@
</include>

<include>
<uri>model://table</uri>
<name>table</name>
<uri>model://drop_table</uri>
<name>drop_table</name>
<pose>2.4 -2.45 0 0 -0 0.0</pose>
</include>

Expand Down
4 changes: 2 additions & 2 deletions eyantra_warehouse/worlds/eyantra_warehouse_task2b.world
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@
</include>

<include>
<uri>model://table</uri>
<name>table</name>
<uri>model://drop_table</uri>
<name>drop_table</name>
<pose>2.4 -2.45 0 0 -0 0.0</pose>
</include>

Expand Down
Loading

0 comments on commit ed1e053

Please sign in to comment.