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

Adding simulation time parameter for the controller manager #138

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

eslamsalahelsheikh
Copy link
Contributor

Adding the simulation parameter so that the controller manager uses the simulation time instead of the ROS time. The '/odom' and corresponding tf will only be published if this parameter is set to true.

Adding the simulation parameter so that the controller manager uses the simulation time instead of the ROS time.  The '/odom' and corresponding tf will only be published if this parameter is set to true.
@eslamsalahelsheikh eslamsalahelsheikh changed the title Fix publishing using simulation time in control manager Adding simulation time parameter for the controller manager Jun 18, 2022
@destogl
Copy link
Member

destogl commented Jun 24, 2022

I don't understand this. This shouldn't affect the publication of anything. Are you sure that you are checking the correct setup?

If yes, please elaborate on the exact behavior.

@eslamsalahelsheikh
Copy link
Contributor Author

I don't understand this. This shouldn't affect the publication of anything. Are you sure that you are checking the correct setup?

If yes, please elaborate on the exact behavior.

Hi Denis,
the thing is that inside the diff_drive_controller there is a check on the previous publishing time (you get it from here) and comparing it with the current time which is passed to the controller in this line from the gazebo plugin here, and Gazebo is always using the simulation time , so if the controller manager isn't using the same simulation time, this if condition will be always false and the odom and tf will not be published.

you can verify this easily if you run the diff_drive example with same setup you have here and check if there is anything published on the "/odom" topic

@destogl
Copy link
Member

destogl commented Jun 28, 2022

OK, I see this. Not sure if this should be also fixed in the diff drive controller in general. But you are right this is at least fastest solution for now and probably will cover a lot of use-cases.

Thanks!

@destogl destogl merged commit 0a4edd7 into ros-controls:master Jun 28, 2022
ahcorde added a commit to ahcorde/rosdistro that referenced this pull request Jul 5, 2022
Increasing version of package(s) in repository `gazebo_ros2_control` to `0.3.1-1`:

- upstream repository: https://github.com/ros-simulation/gazebo_ros2_control.git
- release repository: https://github.com/ros2-gbp/gazebo_ros2_control-release.git
- distro file: `rolling/distribution.yaml`
- bloom version: `0.11.1`
- previous version for package: `0.3.0-1`

```
* Added logic for activating hardware interfaces (ros#139 <ros-controls/gazebo_ros2_control#139>)
* Adjust repo URL (ros#134 <ros-controls/gazebo_ros2_control#134>)
* Contributors: Alejandro Hernández Cordero, Bence Magyar
```

```
* Fixed CMake source file extension (ros#140 <ros-controls/gazebo_ros2_control#140>)
* Adding simulation time parameter for the controller manager (ros#138 <ros-controls/gazebo_ros2_control#138>)
  Adding the simulation parameter so that the controller manager uses the simulation time instead of the ROS time.  The '/odom' and corresponding tf will only be published if this parameter is set to true.
* Adjust repo URL (ros#134 <ros-controls/gazebo_ros2_control#134>)
* Changed launch variable name (ros#130 <ros-controls/gazebo_ros2_control#130>)
* Contributors: Alejandro Hernández Cordero, Bence Magyar, Eslam Salah, Jakub "Deli" Delicat
```

Signed-off-by: ahcorde <ahcorde@gmail.com>
tfoote pushed a commit to ros/rosdistro that referenced this pull request Jul 7, 2022
…33784)

Increasing version of package(s) in repository `gazebo_ros2_control` to `0.3.1-1`:

- upstream repository: https://github.com/ros-simulation/gazebo_ros2_control.git
- release repository: https://github.com/ros2-gbp/gazebo_ros2_control-release.git
- distro file: `rolling/distribution.yaml`
- bloom version: `0.11.1`
- previous version for package: `0.3.0-1`

```
* Added logic for activating hardware interfaces (#139 <ros-controls/gazebo_ros2_control#139>)
* Adjust repo URL (#134 <ros-controls/gazebo_ros2_control#134>)
* Contributors: Alejandro Hernández Cordero, Bence Magyar
```

```
* Fixed CMake source file extension (#140 <ros-controls/gazebo_ros2_control#140>)
* Adding simulation time parameter for the controller manager (#138 <ros-controls/gazebo_ros2_control#138>)
  Adding the simulation parameter so that the controller manager uses the simulation time instead of the ROS time.  The '/odom' and corresponding tf will only be published if this parameter is set to true.
* Adjust repo URL (#134 <ros-controls/gazebo_ros2_control#134>)
* Changed launch variable name (#130 <ros-controls/gazebo_ros2_control#130>)
* Contributors: Alejandro Hernández Cordero, Bence Magyar, Eslam Salah, Jakub "Deli" Delicat
```

Signed-off-by: ahcorde <ahcorde@gmail.com>
ahcorde pushed a commit that referenced this pull request Nov 7, 2022
Adding the simulation parameter so that the controller manager uses the simulation time instead of the ROS time.  The '/odom' and corresponding tf will only be published if this parameter is set to true.
destogl pushed a commit that referenced this pull request Nov 14, 2022
)

Co-authored-by: Eslam Salah <eslamsalahelsheikh@gmail.com>
ahcorde added a commit that referenced this pull request Nov 14, 2022
)

Co-authored-by: Eslam Salah <eslamsalahelsheikh@gmail.com>
ahcorde added a commit that referenced this pull request Nov 21, 2022
* fix maintainer email (#92)

Signed-off-by: ahcorde <ahcorde@gmail.com>

* CHANGELOG

Signed-off-by: ahcorde <ahcorde@gmail.com>

* 0.0.4

* 0.0.5

* Update Foxy dockerfile (#101)

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Declare dependency of gazebo_hardware_plugins to urdf in CMakeLists.txt (#117) (#119)

Co-authored-by: Martin Wudenka <Martin.Wudenka@gmx.de>

* Added diff drive example (#113)

Signed-off-by: ahcorde <ahcorde@gmail.com>

* changelog

Signed-off-by: ahcorde <ahcorde@gmail.com>

* 0.1.0

* [backport Foxy] #136 #147 #139 #134 (#150)

* Implemented perform_command_mode_switch override in GazeboSystem (#136)
* added namespace to controller manager (#147)
* Added logic for activating hardware interfaces (#139)

Signed-off-by: ahcorde <ahcorde@gmail.com>
Co-authored-by: Keegan Sotebeer <ksotebeer95@gmail.com>
Co-authored-by: Maciej Bednarczyk <83034299+mcbed@users.noreply.github.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>

* [Backport Foxy] Support for mimic joints and example with gripper. (#121)

* [Backport Foxy] Support for mimic joints and example with gripper.

* Enable loading params from multiple yaml files (#149) (#151)

Co-authored-by: Tony Najjar <tony.najjar@logivations.com>

* Adding simulation time parameter for the controller manager (#138) (#158)

Co-authored-by: Eslam Salah <eslamsalahelsheikh@gmail.com>

* Changelog

Signed-off-by: ahcorde <ahcorde@gmail.com>

* 0.1.1

* Add pre-commit hooks configuration (#161)

* Add pre-commit hooks configuration

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>

* Pre-commit in a separate action

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>

* Fix codespell

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>

Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Co-authored-by: Martin Wudenka <Martin.Wudenka@gmx.de>
Co-authored-by: Keegan Sotebeer <ksotebeer95@gmail.com>
Co-authored-by: Maciej Bednarczyk <83034299+mcbed@users.noreply.github.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Co-authored-by: Tony Najjar <tony.najjar@logivations.com>
Co-authored-by: Eslam Salah <eslamsalahelsheikh@gmail.com>
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.

None yet

2 participants