Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/robot_control/launch/gazebo_gui.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def generate_launch_description():
{"use_sim_time": True},
{"moveit_current_state_monitor.joint_state_qos": "sensor_data"},
], # Pass the MoveIt config to the GUI node
# arguments=['--ros-args', '--log-level', 'debug'],
)

# Return the LaunchDescription
Expand Down
16 changes: 14 additions & 2 deletions src/robot_control/launch/moveit_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import os
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node
from moveit_configs_utils import MoveItConfigsBuilder

Expand All @@ -22,11 +23,22 @@ def generate_launch_description():
@return LaunchDescription object containing the nodes to launch.
"""

# Load the MoveIt configuration using MoveItConfigsBuilder
# Specify the name of the package and path to xacro file within the package
pkg_name = "robot_description" # Name of the robot description package
share_dir = get_package_share_directory(
pkg_name
) # Get the share directory of the package

# Use xacro to process the file
xacro_file = os.path.join(
share_dir, "urdf", "r5a_v_ros.urdf.xacro"
) # Full path to the XACRO file

# MoveIt configuration using MoveItConfigsBuilder
moveit_config = (
MoveItConfigsBuilder("robot_moveit_config", package_name="robot_moveit_config")
.robot_description(
file_path="config/r5a_v_ros.urdf.xacro", mappings={"use_sim_time": "true"}
file_path=xacro_file, mappings={"use_sim_time": "true"}
)
.robot_description_semantic("config/armr5.srdf")
.robot_description_kinematics("config/kinematics.yaml")
Expand Down
16 changes: 14 additions & 2 deletions src/robot_control/launch/moveit_control2.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import os
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node
from moveit_configs_utils import MoveItConfigsBuilder

Expand All @@ -21,11 +22,22 @@ def generate_launch_description():
@return LaunchDescription object containing the robot control node.
"""

# Load the MoveIt configuration using MoveItConfigsBuilder
# Specify the name of the package and path to xacro file within the package
pkg_name = "robot_description" # Name of the robot description package
share_dir = get_package_share_directory(
pkg_name
) # Get the share directory of the package

# Use xacro to process the file
xacro_file = os.path.join(
share_dir, "urdf", "r5a_v_ros.urdf.xacro"
) # Full path to the XACRO file

# MoveIt configuration using MoveItConfigsBuilder
moveit_config = (
MoveItConfigsBuilder("robot_moveit_config", package_name="robot_moveit_config")
.robot_description(
file_path="config/r5a_v_ros.urdf.xacro", mappings={"use_sim_time": "true"}
file_path=xacro_file, mappings={"use_sim_time": "true"}
)
.robot_description_semantic("config/armr5.srdf")
.robot_description_kinematics("config/kinematics.yaml")
Expand Down
16 changes: 14 additions & 2 deletions src/robot_control/launch/moveit_control_gui.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import os
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node
from moveit_configs_utils import MoveItConfigsBuilder

Expand All @@ -22,11 +23,22 @@ def generate_launch_description():
@return LaunchDescription object containing the GUI node.
"""

# Load the MoveIt configuration using MoveItConfigsBuilder
# Specify the name of the package and path to xacro file within the package
pkg_name = "robot_description" # Name of the robot description package
share_dir = get_package_share_directory(
pkg_name
) # Get the share directory of the package

# Use xacro to process the file
xacro_file = os.path.join(
share_dir, "urdf", "r5a_v_ros.urdf.xacro"
) # Full path to the XACRO file

# MoveIt configuration using MoveItConfigsBuilder
moveit_config = (
MoveItConfigsBuilder("robot_moveit_config", package_name="robot_moveit_config")
.robot_description(
file_path="config/r5a_v_ros.urdf.xacro", mappings={"use_sim_time": "true"}
file_path=xacro_file, mappings={"use_sim_time": "true"}
)
.robot_description_semantic("config/armr5.srdf")
.robot_description_kinematics("config/kinematics.yaml")
Expand Down
18 changes: 9 additions & 9 deletions src/robot_control/launch/visual_sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def generate_launch_description():
This function sets up the robot description, launches Gazebo with a custom world file,
spawns the robot entity, configures MoveIt, and starts the necessary nodes and controllers,
including the GUI node, object detector node, and visual joint state publisher node.

It now accepts a parameter 'num_cameras' to determine whether to launch the single or double ArUco detector.

@return LaunchDescription object containing all the nodes and configurations to launch.
"""

Expand Down Expand Up @@ -77,7 +77,7 @@ def generate_launch_description():
parameters=[robot_description, {"use_sim_time": True}],
)

# Gazebo launch with a custom world file that includes a spotlight
# Gazebo Launch
world_file_path = os.path.join(
share_dir, "worlds", "spotlight.world"
) # Path to the custom world file
Expand Down Expand Up @@ -156,7 +156,6 @@ def generate_launch_description():
)

load_gripper_controller = ExecuteProcess(

cmd=[
"ros2",
"control",
Expand All @@ -166,8 +165,8 @@ def generate_launch_description():
"gripper_controller",
],
output="screen",

)

# Launch the GUI Node
gui_node = Node(
package="robot_control", # Package name containing the GUI node
Expand All @@ -177,7 +176,7 @@ def generate_launch_description():
moveit_config.to_dict(),
{"use_sim_time": True},
{"moveit_current_state_monitor.joint_state_qos": "sensor_data"},
], # Pass MoveIt config to the GUI node
], # Pass the MoveIt config to the GUI node
)

# Aruco Detector Single Node
Expand Down Expand Up @@ -220,7 +219,6 @@ def generate_launch_description():
output='screen',
parameters=[{'use_sim_time': True}]
),

SetParameter(name="use_sim_time", value=True), # Enable simulation time
RegisterEventHandler(
event_handler=OnProcessExit(
Expand All @@ -237,8 +235,10 @@ def generate_launch_description():
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=load_arm_controller,
on_exit=[load_gripper_controller, move_group_node], # Load gripper controller before move group

on_exit=[
load_gripper_controller,
move_group_node
], # Load gripper controller before move group
)
),
RegisterEventHandler(
Expand Down
4 changes: 3 additions & 1 deletion src/robot_description/launch/gazebo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def generate_launch_description():

# Specify the name of the package and path to xacro file within the package
pkg_name = "robot_description" # Name of the robot description package

share_dir = get_package_share_directory(
pkg_name
) # Get the share directory of the package
Expand All @@ -58,6 +57,7 @@ def generate_launch_description():
{"use_sim_time": True},
], # Parameters
)

# Node to spawn the entity in Gazebo
spawn_entity = Node(
package="gazebo_ros", # Package containing the node
Expand All @@ -70,6 +70,7 @@ def generate_launch_description():
], # Arguments for spawning
output="screen",
)

# Include the Gazebo launch file
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand All @@ -92,6 +93,7 @@ def generate_launch_description():
], # Command to load and activate joint_state_broadcaster
output="screen",
)

load_arm_controller = ExecuteProcess(
cmd=[
"ros2",
Expand Down
2 changes: 1 addition & 1 deletion src/robot_description/launch/gazebo_move.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def generate_launch_description():
moveit_config = (
MoveItConfigsBuilder("robot_moveit_config", package_name="robot_moveit_config")
.robot_description(
file_path="config/r5a_v_ros.urdf.xacro", mappings={"use_sim_time": "true"}
file_path=xacro_file, mappings={"use_sim_time": "true"}
)
.robot_description_semantic("config/armr5.srdf")
.robot_description_kinematics("config/kinematics.yaml")
Expand Down
Loading