Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Humble] Gazebo simulation failing after merging #1272 #1299

Closed
Noel215 opened this issue Jan 16, 2024 · 3 comments · Fixed by ros-controls/gazebo_ros2_control#262 or #1301
Closed
Labels

Comments

@Noel215
Copy link
Contributor

Noel215 commented Jan 16, 2024

Hi,

After merging the PR #1272 the TIAGo simulation is failing. The original issue is reported in pal-robotics/tiago_simulation#28.
Could you take a look, please?

I've been running as well the diff_drive example in the gazebo_ros2_control_demos:

ros2 launch gazebo_ros2_control_demos diff_drive.launch.py

and its output is the following

[gzserver-1] [INFO] [1705401148.489354723] [resource_manager]: Initialize hardware 'GazeboSystem' 
[gzserver-1] [INFO] [1705401148.489951706] [resource_manager]: Successful initialization of hardware 'GazeboSystem'
[gzserver-1] [INFO] [1705401148.491561292] [resource_manager]: 'configure' hardware 'GazeboSystem' 
[gzserver-1] [INFO] [1705401148.491615401] [resource_manager]: Successful 'configure' of hardware 'GazeboSystem'
[gzserver-1] [INFO] [1705401148.491673808] [resource_manager]: 'activate' hardware 'GazeboSystem' 
[gzserver-1] [INFO] [1705401148.491677966] [resource_manager]: Successful 'activate' of hardware 'GazeboSystem'
[gzserver-1] [INFO] [1705401148.491962439] [gazebo_ros2_control]: Loading controller_manager
[gzserver-1] [INFO] [1705401148.506958281] [controller_manager]: Subscribing to '~/robot_description' topic for robot description file.
[gzserver-1] [WARN] [1705401148.511946567] [gazebo_ros2_control]:  Desired controller update period (0.01 s) is slower than the gazebo simulation period (0.001 s).
[gzserver-1] [INFO] [1705401148.512763337] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 119154]
[INFO] [ros2-5]: process started with pid [119278]
[ros2-5] Could not contact service /controller_manager/load_controller
[ERROR] [ros2-5]: process has died [pid 119278, exit code 1, cmd 'ros2 control load_controller --set-state active joint_state_broadcaster'].
[INFO] [ros2-6]: process started with pid [119438]
[ros2-6] Could not contact service /controller_manager/load_controller
[ERROR] [ros2-6]: process has died [pid 119438, exit code 1, cmd 'ros2 control load_controller --set-state active diff_drive_base_controller'].

I think something of that PR has broken the GazeboSystem plugin in https://github.com/ros-controls/gazebo_ros2_control/.

@Noel215 Noel215 added the bug label Jan 16, 2024
@saikishor
Copy link
Member

The issue is coming from the resource_manager object created in the gazebo_ros2_control_plugin, as it is not initialized with the URDF. With the recent PR that we merged regarding the initializing of CM services only after the resource manager is completely initialized, this is breaking. We need to find a proper solution to fix this issue.

https://github.com/ros-controls/gazebo_ros2_control/blob/60e4b75f4a786c9563d7dd97c6d08a31ca69c5b1/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp#L365-L371

@christophfroehlich
Copy link
Contributor

I also ran into the same problem, reproducible also with ros2 launch ros2_control_demo_example_9 rrbot_gazebo_classic.launch.py

should we revert #1272 until we've found a solution?

@saikishor
Copy link
Member

I think reverting #1272 will bring back the same problem of: #1262. I'll try to find some solution soon. The solution seems to add a parameter to the load_urdf method inside the resource manager, not to load and initialize the system or somehow get the URDF into the resource manager

saikishor added a commit to saikishor/gazebo_ros2_control that referenced this issue Jan 16, 2024
saikishor added a commit to saikishor/gazebo_ros2_control that referenced this issue Jan 16, 2024
saikishor added a commit to saikishor/ros2_control that referenced this issue Jan 16, 2024
destogl pushed a commit that referenced this issue Jan 17, 2024
* check the components size instead of the variable (fixes #1299)
* add new load_and_initialize_components default argument to the load_urdf method
mergify bot pushed a commit that referenced this issue Jan 17, 2024
* check the components size instead of the variable (fixes #1299)
* add new load_and_initialize_components default argument to the load_urdf method

(cherry picked from commit 510ba73)

# Conflicts:
#	hardware_interface/src/resource_manager.cpp
mergify bot pushed a commit that referenced this issue Jan 17, 2024
* check the components size instead of the variable (fixes #1299)
* add new load_and_initialize_components default argument to the load_urdf method

(cherry picked from commit 510ba73)
saikishor added a commit to saikishor/ros2_control that referenced this issue Jan 18, 2024
* check the components size instead of the variable (fixes ros-controls#1299)
* add new load_and_initialize_components default argument to the load_urdf method
saikishor added a commit to saikishor/ros2_control that referenced this issue Jan 18, 2024
* check the components size instead of the variable (fixes ros-controls#1299)
* add new load_and_initialize_components default argument to the load_urdf method
destogl pushed a commit that referenced this issue Jan 18, 2024
* check the components size instead of the variable (fixes #1299)
* add new load_and_initialize_components default argument to the load_urdf method

(cherry picked from commit 510ba73)
ahcorde pushed a commit to ros-controls/gazebo_ros2_control that referenced this issue Jan 22, 2024
* Load the URDF to the resource_manager before parsing it to CM constructor (fixes ros-controls/ros2_control#1299)
mergify bot pushed a commit to ros-controls/gazebo_ros2_control that referenced this issue Jan 22, 2024
* Load the URDF to the resource_manager before parsing it to CM constructor (fixes ros-controls/ros2_control#1299)

(cherry picked from commit f5baf71)
mergify bot pushed a commit to ros-controls/gazebo_ros2_control that referenced this issue Jan 22, 2024
* Load the URDF to the resource_manager before parsing it to CM constructor (fixes ros-controls/ros2_control#1299)

(cherry picked from commit f5baf71)
ahcorde added a commit to ros-controls/gazebo_ros2_control that referenced this issue Jan 23, 2024
…267)

* Load the URDF to the resource_manager before parsing it to CM constructor (fixes ros-controls/ros2_control#1299)

(cherry picked from commit f5baf71)

Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
ahcorde added a commit to ros-controls/gazebo_ros2_control that referenced this issue Jan 23, 2024
…266)

* Load the URDF to the resource_manager before parsing it to CM constructor (fixes ros-controls/ros2_control#1299)

(cherry picked from commit f5baf71)

Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants