Skip to content

Commit b296ff2

Browse files
authored
Merge pull request #103 from ros-controls/ahcorde/galactic_to_main_25_11_2022
Galactic to master
2 parents 4546cb7 + 0ab4e97 commit b296ff2

File tree

9 files changed

+202
-14
lines changed

9 files changed

+202
-14
lines changed

.github/workflows/ci-format.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This is a format job. Pre-commit has a first-party GitHub action, so we use
2+
# that: https://github.com/pre-commit/action
3+
4+
name: Format
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
10+
jobs:
11+
pre-commit:
12+
name: Format
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.10.6
19+
- name: Install system hooks
20+
run: sudo apt install -qq cppcheck ament-cmake-uncrustify ament-cmake-pep257
21+
- uses: pre-commit/[email protected]
22+
with:
23+
extra_args: --all-files --hook-stage manual

.github/workflows/triage.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ jobs:
1616
COLUMN: Inbox
1717
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}
1818
CHECK_ORG_PROJECT: true
19-

.pre-commit-config.yaml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
14+
15+
repos:
16+
# Standard hooks
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v4.1.0
19+
hooks:
20+
- id: check-added-large-files
21+
- id: check-ast
22+
- id: check-case-conflict
23+
- id: check-docstring-first
24+
- id: check-merge-conflict
25+
- id: check-symlinks
26+
- id: check-xml
27+
- id: check-yaml
28+
- id: debug-statements
29+
- id: end-of-file-fixer
30+
- id: mixed-line-ending
31+
- id: trailing-whitespace
32+
exclude_types: [rst]
33+
- id: fix-byte-order-marker
34+
35+
36+
# Python hooks
37+
- repo: https://github.com/asottile/pyupgrade
38+
rev: v2.31.1
39+
hooks:
40+
- id: pyupgrade
41+
args: [--py36-plus]
42+
43+
# # PEP 257
44+
- repo: local
45+
hooks:
46+
- id: ament_pep257
47+
name: ament_pep257
48+
description: Format files with pep257.
49+
entry: ament_pep257
50+
language: system
51+
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]
52+
53+
- repo: https://github.com/pycqa/flake8
54+
rev: 4.0.1
55+
hooks:
56+
- id: flake8
57+
args: ["--extend-ignore=E501"]
58+
59+
# CPP hooks
60+
- repo: local
61+
hooks:
62+
- id: ament_uncrustify
63+
name: ament_uncrustify
64+
description: Format files with uncrustify.
65+
entry: ament_uncrustify
66+
language: system
67+
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
68+
args: ["--reformat"]
69+
70+
- repo: local
71+
hooks:
72+
- id: ament_cppcheck
73+
name: ament_cppcheck
74+
description: Static code analysis of C/C++ files.
75+
stages: [commit]
76+
entry: ament_cppcheck
77+
language: system
78+
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
79+
80+
# Maybe use https://github.com/cpplint/cpplint instead
81+
- repo: local
82+
hooks:
83+
- id: ament_cpplint
84+
name: ament_cpplint
85+
description: Static code analysis of C/C++ files.
86+
stages: [commit]
87+
entry: ament_cpplint
88+
language: system
89+
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
90+
args: ["--linelength=100", "--filter=-whitespace/newline"]
91+
92+
# Cmake hooks
93+
- repo: local
94+
hooks:
95+
- id: ament_lint_cmake
96+
name: ament_lint_cmake
97+
description: Check format of CMakeLists.txt files.
98+
stages: [commit]
99+
entry: ament_lint_cmake
100+
language: system
101+
files: CMakeLists\.txt$
102+
103+
# Copyright
104+
- repo: local
105+
hooks:
106+
- id: ament_copyright
107+
name: ament_copyright
108+
description: Check if copyright notice is available in all files.
109+
stages: [commit]
110+
entry: ament_copyright
111+
language: system
112+
113+
# Docs - RestructuredText hooks
114+
- repo: https://github.com/PyCQA/doc8
115+
rev: 0.10.1
116+
hooks:
117+
- id: doc8
118+
args: ['--max-line-length=100', '--ignore=D001']
119+
exclude: CHANGELOG\.rst$
120+
121+
- repo: https://github.com/pre-commit/pygrep-hooks
122+
rev: v1.9.0
123+
hooks:
124+
- id: rst-backticks
125+
exclude: CHANGELOG\.rst$
126+
- id: rst-directive-colons
127+
- id: rst-inline-touching-normal
128+
129+
# Spellcheck in comments and docs
130+
# skipping of *.svg files is not working...
131+
- repo: https://github.com/codespell-project/codespell
132+
rev: v2.1.0
133+
hooks:
134+
- id: codespell
135+
args: ['--write-changes']
136+
exclude: CHANGELOG\.rst|\.(svg|pyc)$

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# ign_ros2_control
22

3+
ROS2 Distro | Build Status | Package build |
4+
:---------: | :----: | :----------: |
5+
[![Licence](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![Build Status](http://build.ros2.org/buildStatus/icon?job=Gdev__ign_ros2_control__ubuntu_focal_amd64)](http://build.ros2.org/job/Gdev__ign_ros2_control__ubuntu_focal_amd64) | [![Build Status](http://build.ros2.org/buildStatus/icon?job=Gbin_uF64__ign_ros2_control__ubuntu_focal_amd64__binary)](http://build.ros2.org/job/Gbin_uF64__ign_ros2_control__ubuntu_focal_amd64__binary) |
6+
37
This is a ROS 2 package for integrating the `ros2_control` controller architecture with the [Ignition Gazebo](http://ignitionrobotics.org/) simulator.
48
More information about `ros2_control` can be found here: https://control.ros.org/
59

610
This package provides an Ignition Gazebo system plugin which instantiates a `ros2_control` controller manager and connects it to a Gazebo model.
711

8-
Tested on:
12+
[![Build Status](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci.yaml/badge.svg?branch=galactic)](https://github.com/ros-controls/gz_ros2_control/actions/workflows/ci.yaml)
913

10-
- Debs:
11-
- [Ignition Edifice](https://ignitionrobotics.org/docs/edifice) + [ROS 2 Galactic](https://docs.ros.org/en/galactic/Installation.html)
12-
- From source:
13-
- [Ignition Citadel](https://ignitionrobotics.org/docs/citadel) + [ROS 2 Galactic](https://docs.ros.org/en/galactic/Installation.html)
14-
- [Ignition Fortress](https://ignitionrobotics.org/docs/fortress) + [ROS 2 Galactic](https://docs.ros.org/en/galactic/Installation.html)
14+
ROS version | Ignition version | Branch | Binaries hosted at
15+
-- | -- | -- | --
16+
Foxy | Citadel | [foxy](https://github.com/ros-controls/gz_ros2_control/tree/foxy) | https://packages.ros.org
17+
Foxy | Edifice | [foxy](https://github.com/ros-controls/gz_ros2_control/tree/foxy) | only from source
18+
Galactic | Edifice | [galactic](https://github.com/ros-controls/gz_ros2_control/tree/galactic) | https://packages.ros.org
19+
Galactic | Fortress | [galactic](https://github.com/ros-controls/gz_ros2_control/tree/galactic) | only from source
20+
Humble | Fortress | [ros2](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org
21+
Rolling | Edifice | [ros2](https://github.com/ros-controls/gz_ros2_control/tree/master) | only from source
22+
Rolling | Fortress | [ros2](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org
23+
Rolling | Garden (not released) | [ros2](https://github.com/ros-controls/gz_ros2_control/tree/master) | only from source
1524

16-
If you want to run this with `ROS 2 Foxy` please check the branch `foxy`.
1725

1826
# Compile from source
1927

ign_ros2_control/CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ Changelog for package ign_ros2_control
2222
* Add support for initial_values for hardware interfaces when starting simulation. (`#27 <https://github.com/ros-controls/gz_ros2_control/issues/27>`_)
2323
* Contributors: Alejandro Hernández Cordero, Denis Štogl, Guillaume Beuzeboc, Tianyu Li
2424

25+
0.4.1 (2022-06-06)
26+
------------------
27+
* Remove URDF dependency (`#56 <https://github.com/ignitionrobotics/ign_ros2_control/issues/56>`_)
28+
* typo in citadel name (`#54 <https://github.com/ignitionrobotics/ign_ros2_control/issues/54>`_)
29+
* Contributors: Alejandro Hernández Cordero, Guillaume Beuzeboc, ahcorde
30+
2531
0.4.0 (2022-03-18)
2632
------------------
2733
* Fix default ign gazebo version Galactic (`#44 <https://github.com/ignitionrobotics/ign_ros2_control/issues/44>`_)

ign_ros2_control/src/ign_ros2_control_plugin.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ void IgnitionROS2ControlPlugin::Configure(
270270
return;
271271
}
272272

273+
std::vector<std::string> arguments = {"--ros-args"};
274+
275+
auto sdfPtr = const_cast<sdf::Element *>(_sdf.get());
276+
277+
sdf::ElementPtr argument_sdf = sdfPtr->GetElement("parameters");
278+
while (argument_sdf) {
279+
std::string argument = argument_sdf->Get<std::string>();
280+
arguments.push_back(RCL_PARAM_FILE_FLAG);
281+
arguments.push_back(argument);
282+
argument_sdf = argument_sdf->GetNextElement("parameters");
283+
}
284+
273285
// Get controller manager node name
274286
std::string controllerManagerNodeName{"controller_manager"};
275287

@@ -279,9 +291,6 @@ void IgnitionROS2ControlPlugin::Configure(
279291
controllerManagerNodeName = controllerManagerPrefixNodeName + "_" + controllerManagerNodeName;
280292
}
281293

282-
std::vector<std::string> arguments = {"--ros-args", "--params-file", paramFileName};
283-
auto sdfPtr = const_cast<sdf::Element *>(_sdf.get());
284-
285294
if (sdfPtr->HasElement("ros")) {
286295
sdf::ElementPtr sdfRos = sdfPtr->GetElement("ros");
287296

ign_ros2_control_demos/CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ Changelog for package ign_ros2_control_demos
1313
* Add support for initial_values for hardware interfaces when starting simulation. (`#27 <https://github.com/ros-controls/gz_ros2_control/issues/27>`_)
1414
* Contributors: Alejandro Hernández Cordero, Andrej Orsula, Bence Magyar, Denis Štogl, Maciej Bednarczyk, ahcorde
1515

16+
0.4.1 (2022-06-06)
17+
------------------
18+
* ign_ros2_control_demos: Install urdf dir (`#61 <https://github.com/ignitionrobotics/ign_ros2_control/issues/61>`_)
19+
* Remove URDF dependency (`#56 <https://github.com/ignitionrobotics/ign_ros2_control/issues/56>`_)
20+
* Contributors: Alejandro Hernández Cordero, Andrej Orsula
21+
22+
1623
0.4.0 (2022-03-18)
1724
------------------
1825

ign_ros2_control_demos/config/tricycle_drive_controller.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ joint_state_broadcaster:
1212
ros__parameters:
1313
extra_joints: ["right_wheel_joint", "left_wheel_joint"]
1414

15-
tricycle_controller:
15+
tricycle_controller:
1616
ros__parameters:
1717
# Model
1818
traction_joint_name: traction_joint # Name of traction joint in URDF
@@ -30,7 +30,7 @@ tricycle_controller:
3030
pose_covariance_diagonal: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # Need to be set if fusing odom with other localization source
3131
twist_covariance_diagonal: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # Need to be set if fusing odom with other localization source
3232
velocity_rolling_window_size: 10 # Rolling window size of rcppmath::RollingMeanAccumulator applied on linear and angular speeds published on odom
33-
33+
3434
# Rate Limiting
3535
traction: # All values should be positive
3636
# min_velocity: 0.0

ign_ros2_control_demos/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<license>Apache License 2.0</license>
1010

11-
<url type="website">https://github.com/ros-controls/gz_ros2_control/blob/main/README.md</url>
11+
<url type="website">https://github.com/ros-controls/gz_ros2_control/blob/master/README.md</url>
1212
<url type="bugtracker">https://github.com/ros-controls/gz_ros2_control/issues</url>
1313
<url type="repository">https://github.com/ros-controls/gz_ros2_control</url>
1414

0 commit comments

Comments
 (0)