Skip to content

Commit

Permalink
Merge branch 'master' into fix/proportional_gain
Browse files Browse the repository at this point in the history
  • Loading branch information
ahcorde authored Aug 26, 2024
2 parents 676ed97 + 30e6705 commit bf05e56
Show file tree
Hide file tree
Showing 33 changed files with 587 additions and 220 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci-humble.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: ign_ros2_control CI - Humble

on:
workflow_dispatch:
pull_request:
branches: [ humble ]
push:
branches: [ humble ]
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '33 5 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- version: fortress
ros-repo-packages: ""
- version: fortress
ros-repo-packages: "-testing"
env:
IGNITION_VERSION: ${{ matrix.version }}
ROS_REPO_PACKAGES: ${{ matrix.ros-repo-packages }}
container:
image: ubuntu:22.04
steps:
- name: Checkout code
if: github.event_name != 'schedule'
uses: actions/checkout@v4
- name: Checkout code for scheduled workflow
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: humble
- name: Setup colcon workspace
id: configure
run: |
export DEBIAN_FRONTEND=noninteractive
apt update -qq
apt install -qq -y lsb-release wget curl gnupg2
cd ..
mkdir -p /home/ros2_ws/src
cp -r gz_ros2_control /home/ros2_ws/src/
sh -c 'echo "deb http://packages.ros.org/ros2$ROS_REPO_PACKAGES/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-testing.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
apt-get update && apt-get upgrade -q -y
apt-get update && apt-get install -qq -y \
dirmngr \
python3-colcon-ros \
python3-colcon-common-extensions \
python3-rosdep \
build-essential
cd /home/ros2_ws/src/
rosdep init
rosdep update
rosdep install --from-paths ./ -i -y --rosdistro humble --ignore-src
- name: Build project
id: build
run: |
cd /home/ros2_ws/
. /opt/ros/humble/local_setup.sh
colcon build --packages-up-to ign_ros2_control_demos gz_ros2_control_tests
- name: Run tests
id: test
run: |
cd /home/ros2_ws/
. /opt/ros/humble/local_setup.sh
colcon test --event-handlers console_direct+ --packages-select ign_ros2_control ign_ros2_control_demos gz_ros2_control_tests
colcon test-result
108 changes: 108 additions & 0 deletions .github/workflows/ci-iron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: gz_ros2_control CI - Iron

on:
workflow_dispatch:
pull_request:
branches: [ iron ]
push:
branches: [ iron ]
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '33 4 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- docker-image: "ubuntu:22.04"
gz-version: "fortress"
ros-distro: "iron"
ros-repo-packages: ""
- docker-image: "ubuntu:22.04"
gz-version: "garden"
ros-distro: "iron"
ros-repo-packages: ""
- docker-image: "ubuntu:22.04"
gz-version: "fortress"
ros-distro: "iron"
ros-repo-packages: "-testing"
- docker-image: "ubuntu:22.04"
gz-version: "garden"
ros-distro: "iron"
ros-repo-packages: "-testing"

env:
DOCKER_IMAGE: ${{ matrix.docker-image }}
GZ_VERSION: ${{ matrix.gz-version }}
ROS_DISTRO: ${{ matrix.ros-distro }}
ROS_REPO_PACKAGES: ${{ matrix.ros-repo-packages }}
container:
image: ${{ matrix.docker-image }}
steps:
- name: Checkout code
if: github.event_name != 'schedule'
uses: actions/checkout@v4
- name: Checkout code for scheduled workflow
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: iron
- name: Setup colcon workspace
id: configure
shell: bash
run: |
export DEBIAN_FRONTEND=noninteractive
apt update -qq
apt install -qq -y lsb-release wget curl gnupg2 git
cd ..
mkdir -p /home/ros2_ws/src
if [ "$ROS_DISTRO" == "rolling" ]; then
git clone https://github.com/gazebosim/ros_gz/
fi
cp -r gz_ros2_control /home/ros2_ws/src/
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2$ROS_REPO_PACKAGES/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
if [ "$GZ_VERSION" == "garden" ]; then
export GZ_DEPS="libgz-sim7-dev libgz-plugin2-dev gz-sim7-cli"
fi
apt-get update && apt-get upgrade -q -y
apt-get update && apt-get install -qq -y \
dirmngr \
python3-colcon-ros \
python3-colcon-common-extensions \
python3-rosdep \
build-essential \
${GZ_DEPS}
if [ "$GZ_VERSION" == "garden" ]; then
export ROSDEP_ARGS="--skip-keys ros_gz_sim --skip-keys gz-plugin2 --skip-keys gz-sim7 --skip-keys gz-transport12 --skip-keys gz-math7 --skip-keys gz-msgs9"
fi
cd /home/ros2_ws/src/
if [ "$ROS_DISTRO" == "rolling" ]; then
git clone https://github.com/gazebosim/ros_gz/
fi
if [ "$ROS_DISTRO" == "iron" ]; then
git clone https://github.com/gazebosim/ros_gz/ -b iron
fi
rosdep init
rosdep update
rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} --ignore-src ${ROSDEP_ARGS}
- name: Build project
id: build
run: |
cd /home/ros2_ws/
. /opt/ros/${ROS_DISTRO}/local_setup.sh
colcon build --packages-up-to gz_ros2_control_demos gz_ros2_control_tests
- name: Run tests
id: test
run: |
cd /home/ros2_ws/
. /opt/ros/${ROS_DISTRO}/local_setup.sh
colcon test --event-handlers console_direct+ --packages-select gz_ros2_control gz_ros2_control_demos gz_ros2_control_tests
colcon test-result
76 changes: 76 additions & 0 deletions .github/workflows/ci-jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: gz_ros2_control CI - Jazzy

on:
workflow_dispatch:
pull_request:
branches: [ jazzy ]
push:
branches: [ jazzy ]
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '03 4 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- docker-image: "ubuntu:24.04"
ros-distro: "jazzy"
ros-repo-packages: "-testing"

env:
DOCKER_IMAGE: ${{ matrix.docker-image }}
ROS_DISTRO: ${{ matrix.ros-distro }}
ROS_REPO_PACKAGES: ${{ matrix.ros-repo-packages }}
container:
image: ${{ matrix.docker-image }}
steps:
- name: Checkout code
if: github.event_name != 'schedule'
uses: actions/checkout@v4
- name: Checkout code for scheduled workflow
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: jazzy
- name: Setup colcon workspace
id: configure
shell: bash
run: |
export DEBIAN_FRONTEND=noninteractive
apt update -qq
apt install -qq -y lsb-release wget curl gnupg2 git
cd ..
mkdir -p /home/ros2_ws/src
cp -r gz_ros2_control /home/ros2_ws/src/
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2$ROS_REPO_PACKAGES/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
apt-get update && apt-get upgrade -q -y
apt-get update && apt-get install -qq -y \
dirmngr \
python3-colcon-ros \
python3-colcon-common-extensions \
python3-rosdep \
build-essential
cd /home/ros2_ws/src/
rosdep init
rosdep update
rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} --ignore-src
- name: Build project
id: build
run: |
cd /home/ros2_ws/
. /opt/ros/${ROS_DISTRO}/local_setup.sh
colcon build --packages-up-to gz_ros2_control_demos gz_ros2_control_tests
- name: Run tests
id: test
run: |
cd /home/ros2_ws/
. /opt/ros/${ROS_DISTRO}/local_setup.sh
colcon test --event-handlers console_direct+ --packages-select gz_ros2_control gz_ros2_control_demos gz_ros2_control_tests
colcon test-result
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ Iron | Edifice | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iro
Iron | Fortress | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | https://packages.ros.org | `ros-iron-gz-ros2-control`
Iron | Garden | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source |
Iron | Harmonic | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source |
Jazzy | Harmonic | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org | `ros-jazzy-gz-ros2-control`
Jazzy | Harmonic | [jazzy](https://github.com/ros-controls/gz_ros2_control/tree/jazzy) | https://packages.ros.org | `ros-jazzy-gz-ros2-control`
Rolling | Harmonic | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org | `ros-rolling-gz-ros2-control`

## Build status

ROS 2 Distro | Branch | Build status | Documentation
:----------: | :----: | :----------: | :-----------:
**Rolling** | [`master`](https://github.com/ros-controls/gz_ros2_control/tree/master) | [![gazebo_ros2_control CI - Rolling](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-rolling.yaml/badge.svg?branch=master)](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-rolling.yaml) | [Documentation](https://control.ros.org/master/index.html) <br /> [API Reference](https://control.ros.org/master/doc/api/index.html)
**Rolling** | [`master`](https://github.com/ros-controls/gz_ros2_control/tree/master) | [![gazebo_ros2_control CI - Rolling](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-rolling.yaml/badge.svg?branch=master)](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-rolling.yaml) | [Documentation](https://control.ros.org/rolling/index.html) <br /> [API Reference](https://control.ros.org/rolling/doc/api/index.html)
**Jazzy** | [`jazzy`](https://github.com/ros-controls/gz_ros2_control/tree/jazzy) | [![gazebo_ros2_control CI - Jazzy](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-jazzy.yaml/badge.svg?branch=master)](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-jazzy.yaml) | [Documentation](https://control.ros.org/jazzy/index.html) <br /> [API Reference](https://control.ros.org/jazzy/doc/api/index.html)
**Iron** | [`iron`](https://github.com/ros-controls/gz_ros2_control/tree/iron) | [![gazebo_ros2_control CI - Iron](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-iron.yaml/badge.svg?branch=iron)](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-iron.yaml) | [Documentation](https://control.ros.org/iron/index.html) <br /> [API Reference](https://control.ros.org/iron/doc/api/index.html)
**Humble** | [`humble`](https://github.com/ros-controls/gz_ros2_control/tree/humble) | [![ign_ros2_control CI - Humble](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-humble.yaml/badge.svg?branch=humble)](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci-humble.yaml) | [Documentation](https://control.ros.org/humble/index.html) <br /> [API Reference](https://control.ros.org/humble/doc/api/index.html)

## Documentation
See the [documentation file](doc/index.rst) or [control.ros.org](https://control.ros.org/master/doc/gz_ros2_control/doc/index.html)

Expand Down
4 changes: 3 additions & 1 deletion gz_ros2_control/src/gz_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,14 @@ void GazeboSimROS2ControlPlugin::Configure(

// Create the controller manager
RCLCPP_INFO(this->dataPtr->node_->get_logger(), "Loading controller_manager");
rclcpp::NodeOptions options = controller_manager::get_cm_node_options();
options.arguments(arguments);
this->dataPtr->controller_manager_.reset(
new controller_manager::ControllerManager(
std::move(resource_manager_),
this->dataPtr->executor_,
controllerManagerNodeName,
this->dataPtr->node_->get_namespace()));
this->dataPtr->node_->get_namespace(), options));
this->dataPtr->executor_->add_node(this->dataPtr->controller_manager_);

this->dataPtr->update_rate = this->dataPtr->controller_manager_->get_update_rate();
Expand Down
5 changes: 1 addition & 4 deletions gz_ros2_control_demos/config/ackermann_drive_controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ controller_manager:
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster


ackermann_steering_controller:
type: 'ackermann_steering_controller/AckermannSteeringController'

ackermann_steering_controller:
ros__parameters:
type: 'ackermann_steering_controller/AckermannSteeringController'
wheelbase: 1.7
front_wheel_track: 1.0
rear_wheel_track: 1.0
Expand Down
4 changes: 1 addition & 3 deletions gz_ros2_control_demos/config/cart_controller_effort.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ controller_manager:
ros__parameters:
update_rate: 1000 # Hz

effort_controller:
type: effort_controllers/JointGroupEffortController

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

effort_controller:
ros__parameters:
type: effort_controllers/JointGroupEffortController
joints:
- slider_to_cart
4 changes: 1 addition & 3 deletions gz_ros2_control_demos/config/cart_controller_position.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ controller_manager:
ros__parameters:
update_rate: 1000 # Hz

joint_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

joint_trajectory_controller:
ros__parameters:
type: joint_trajectory_controller/JointTrajectoryController
joints:
- slider_to_cart
command_interfaces:
Expand Down
8 changes: 2 additions & 6 deletions gz_ros2_control_demos/config/cart_controller_velocity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ controller_manager:
ros__parameters:
update_rate: 1000 # Hz

velocity_controller:
type: velocity_controllers/JointGroupVelocityController

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

imu_sensor_broadcaster:
type: imu_sensor_broadcaster/IMUSensorBroadcaster

velocity_controller:
ros__parameters:
type: velocity_controllers/JointGroupVelocityController
joints:
- slider_to_cart

imu_sensor_broadcaster:
ros__parameters:
type: imu_sensor_broadcaster/IMUSensorBroadcaster
sensor_name: cart_imu_sensor
frame_id: imu
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ controller_manager:
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

diff_drive_base_controller:
type: diff_drive_controller/DiffDriveController

diff_drive_base_controller:
ros__parameters:
type: diff_drive_controller/DiffDriveController
left_wheel_names: ["left_wheel_joint"]
right_wheel_names: ["right_wheel_joint"]

Expand Down
4 changes: 1 addition & 3 deletions gz_ros2_control_demos/config/gripper_controller_effort.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ controller_manager:
ros__parameters:
update_rate: 100 # Hz

gripper_controller:
type: forward_command_controller/ForwardCommandController

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

gripper_controller:
ros__parameters:
type: forward_command_controller/ForwardCommandController
joints:
- right_finger_joint
interface_name: effort
Loading

0 comments on commit bf05e56

Please sign in to comment.