Skip to content

Conversation

@tejashah88
Copy link
Contributor

@tejashah88 tejashah88 commented Aug 4, 2025

Hello again,

I noticed there's been some activity on the repo and I wanted to add a minor QOL PR to how launch commands are constructed. I didn't like the idea of string concatenating complex arguments so I created construct_roslaunch_command, which is a simple command to take the ROS module, launch file and launch commands and create the launch command string.

The easiest comparision is shown below in robo_gym/envs/ur/ur_avoidance_basic.py:

Before

cmd = "roslaunch ur_robot_server ur_robot_server.launch \
        world_name:=tabletop_sphere50.world \
        reference_frame:=base_link \
        max_velocity_scale_factor:=0.2 \
        action_cycle_rate:=20 \
        rviz_gui:=false \
        gazebo_gui:=true \
        objects_controller:=true \
        rs_mode:=1moving2points \
        n_objects:=1.0 \
        object_0_model_name:=sphere50 \
        object_0_frame:=target"

After

cmd = cmd_utils.construct_roslaunch_command(
    module='ur_robot_server',
    launch_file='ur_robot_server.launch',
    launch_args={
        'world_name': 'tabletop_sphere50.world',
        'reference_frame': 'base_link',
        'max_velocity_scale_factor': 0.2,
        'action_cycle_rate': 20,
        'rviz_gui': False,
        'gazebo_gui': True,
        'objects_controller': True,
        'rs_mode': '1moving2points',
        'n_objects': 1.0,
        'object_0_model_name': 'sphere50',
        'object_0_frame': 'target',
        'ur_model': ur_model
    }
)

I haven't checked if this PR works cleanly with the new changes but you can use the test file as a starting reference. Let me know your feedback on this!

Tejas

@tejashah88
Copy link
Contributor Author

I fixed the merge conflicts to match the new format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant