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

Galactic: Pass time and period to update function #88

Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: osrf/ros:foxy-desktop
image: osrf/ros:galactic-desktop
steps:
- uses: actions/checkout@v2
- name: Setup colcon workspace
Expand All @@ -26,18 +26,18 @@ jobs:
python3-colcon-ros
cd /home/ros2_ws/src/
rosdep update
rosdep install --from-paths ./ -i -y --rosdistro foxy \
rosdep install --from-paths ./ -i -y --rosdistro galactic \
--ignore-src
- name: Build project
id: build
run: |
cd /home/ros2_ws/
. /opt/ros/foxy/local_setup.sh
. /opt/ros/galactic/local_setup.sh
colcon build --packages-up-to gazebo_ros2_control_demos
- name: Run tests
id: test
run: |
cd /home/ros2_ws/
. /opt/ros/foxy/local_setup.sh
. /opt/ros/galactic/local_setup.sh
colcon test --event-handlers console_direct+ --packages-select gazebo_ros2_control gazebo_ros2_control_demos
colcon test-result
4 changes: 2 additions & 2 deletions gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ void GazeboRosControlPrivate::Update()
rclcpp::Duration sim_period = sim_time_ros - last_update_sim_time_ros_;

if (sim_period >= control_period_) {
last_update_sim_time_ros_ = sim_time_ros;
controller_manager_->read();
controller_manager_->update();
controller_manager_->update(sim_time_ros, sim_period);
last_update_sim_time_ros_ = sim_time_ros;
}

// Always set commands on joints, otherwise at low control frequencies the joints tremble
Expand Down
2 changes: 1 addition & 1 deletion gazebo_ros2_control_demos/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<exec_depend>gazebo_ros</exec_depend>
<exec_depend>hardware_interface</exec_depend>
<exec_depend>joint_trajectory_controller</exec_depend>
<exec_depend>joint_state_controller</exec_depend>
<exec_depend>joint_state_broadcaster</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
Expand Down