-
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
1 parent
6f5b8b0
commit ed1e053
Showing
13 changed files
with
404 additions
and
122 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,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'), | ||
]) |
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,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 | ||
]) |
File renamed without changes
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
eyantra_warehouse/models/table/model.config → ..._warehouse/models/drop_table/model.config
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.