Skip to content

Conversation

@saikishor
Copy link
Member

Fixes: #20
@pgesel-rai FYI

In future, we can add some changes, like if we set the headless parameter from the launch file, we can toggle the behaviour

@saikishor saikishor self-assigned this Dec 5, 2025
@pgesel-rai
Copy link
Contributor

When I echo /joint_states, I am seeing all zeros. It appears the simulation is not running. However, this may be due testing this change on the humble-devel branch. @saikishor Maybe you have more context, it looks like there are difference, specially with mj_data_control_.

@saikishor
Copy link
Member Author

When I echo /joint_states, I am seeing all zeros. It appears the simulation is not running. However, this may be due testing this change on the humble-devel branch. @saikishor Maybe you have more context, it looks like there are difference, specially with mj_data_control_.

When I checked with rolling it did, I can check it again this evening

@saikishor
Copy link
Member Author

@pgesel-rai I just tested the setup with ros2 launch mujoco_ros2_simulation test_robot.launch.py headless:=true and it works when I send a command both with headless to true and false

@pgesel-rai
Copy link
Contributor

I am going to do some more testing. I wonder if the effort based controller I am running can cause issues. Are you using a position interface?

@saikishor
Copy link
Member Author

I am going to do some more testing. I wonder if the effort based controller I am running can cause issues. Are you using a position interface?

Yes!!

<actuator>
<position name="joint1" joint="joint1" kp="1000" dampratio="1.0"/>
<position name="joint2" joint="joint2" kp="1000" dampratio="1.0"/>
</actuator>

@pgesel-rai
Copy link
Contributor

I messed up the backport. This works on the Humble branch. Looks good!

@saikishor
Copy link
Member Author

I messed up the backport. This works on the Humble branch. Looks good!

I'm glad it is working. Can you approve the PR, if the changes look good to you?

Copy link
Collaborator

@eholum-nasa eholum-nasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! Works beautifully for me on jazzy. Just minor nits about adding some comments.

@pgesel-rai If you have a functional back port ready to go can you open a PR for the humble branch? This is something that we would use on humble, too.

Co-authored-by: Erik Holum <[email protected]>
Copy link
Collaborator

@eholum-nasa eholum-nasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@saikishor saikishor merged commit 55498ed into ros-controls:main Dec 8, 2025
5 checks passed
@saikishor saikishor deleted the support_headless_mode branch December 8, 2025 21:14
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.

Running the simulation in headless mode

3 participants