Skip to content

Commit 40c7b90

Browse files
Use ros2_control_cmake (#753)
* Use ros2_control_cmake * Update repos * Fix compiler errors * Fix more conversion errors * Fix warning: extra ‘;’ [-Wpedantic] * Fix more conversion errors * conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} may change value [-Werror=conversion] * Fix several compiler errors * Fix error: declaration of ‘actuator_interface’ shadows a previous local [-Werror=shadow]
1 parent 534a244 commit 40c7b90

File tree

56 files changed

+117
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+117
-131
lines changed

example_1/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(ros2_control_demo_example_1 LANGUAGES CXX)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra)
6-
endif()
7-
8-
# set the same behavior for windows as it is on linux
9-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
107

118
# find dependencies
129
set(THIS_PACKAGE_INCLUDE_DEPENDS

example_1/hardware/include/ros2_control_demo_example_1/rrbot.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace ros2_control_demo_example_1
3232
class RRBotSystemPositionOnlyHardware : public hardware_interface::SystemInterface
3333
{
3434
public:
35-
RCLCPP_SHARED_PTR_DEFINITIONS(RRBotSystemPositionOnlyHardware);
35+
RCLCPP_SHARED_PTR_DEFINITIONS(RRBotSystemPositionOnlyHardware)
3636

3737
hardware_interface::CallbackReturn on_init(
3838
const hardware_interface::HardwareInfo & info) override;

example_1/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<author email="[email protected]">Dr.-Ing. Denis Štogl</author>
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>
18+
<build_depend>ros2_control_cmake</build_depend>
1819

1920
<depend>backward_ros</depend>
2021
<depend>hardware_interface</depend>

example_10/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(ros2_control_demo_example_10 LANGUAGES CXX)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra)
6-
endif()
7-
8-
# set the same behavior for windows as it is on linux
9-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
107

118
# find dependencies
129
set(THIS_PACKAGE_INCLUDE_DEPENDS

example_10/hardware/include/ros2_control_demo_example_10/rrbot.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace ros2_control_demo_example_10
3232
class RRBotSystemWithGPIOHardware : public hardware_interface::SystemInterface
3333
{
3434
public:
35-
RCLCPP_SHARED_PTR_DEFINITIONS(RRBotSystemWithGPIOHardware);
35+
RCLCPP_SHARED_PTR_DEFINITIONS(RRBotSystemWithGPIOHardware)
3636

3737
hardware_interface::CallbackReturn on_init(
3838
const hardware_interface::HardwareInfo & info) override;

example_10/hardware/rrbot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ hardware_interface::return_type RRBotSystemWithGPIOHardware::read(
194194
}
195195

196196
// random inputs analog_input1 and analog_input2
197-
unsigned int seed = time(NULL) + 1;
197+
unsigned int seed = static_cast<unsigned int>(time(NULL)) + 1;
198198
set_state(
199199
info_.gpios[0].name + "/" + info_.gpios[0].state_interfaces[1].name,
200200
static_cast<float>(rand_r(&seed)));
201-
seed = time(NULL) + 2;
201+
seed = static_cast<unsigned int>(time(NULL)) + 2;
202202
set_state(
203203
info_.gpios[0].name + "/" + info_.gpios[0].state_interfaces[2].name,
204204
static_cast<float>(rand_r(&seed)));

example_10/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<author email="[email protected]">Christoph Froehlich</author>
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>
18+
<build_depend>ros2_control_cmake</build_depend>
1819

1920
<depend>backward_ros</depend>
2021
<depend>hardware_interface</depend>

example_11/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(ros2_control_demo_example_11 LANGUAGES CXX)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra)
6-
endif()
7-
8-
# set the same behavior for windows as it is on linux
9-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
107

118
# find dependencies
129
set(THIS_PACKAGE_INCLUDE_DEPENDS

example_11/hardware/include/ros2_control_demo_example_11/carlikebot_system.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct Joint
5858
class CarlikeBotSystemHardware : public hardware_interface::SystemInterface
5959
{
6060
public:
61-
RCLCPP_SHARED_PTR_DEFINITIONS(CarlikeBotSystemHardware);
61+
RCLCPP_SHARED_PTR_DEFINITIONS(CarlikeBotSystemHardware)
6262

6363
hardware_interface::CallbackReturn on_init(
6464
const hardware_interface::HardwareInfo & info) override;

example_11/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<author email="[email protected]">Reza Kermani</author>
1616

1717
<buildtool_depend>ament_cmake</buildtool_depend>
18+
<build_depend>ros2_control_cmake</build_depend>
1819

1920
<depend>backward_ros</depend>
2021
<depend>hardware_interface</depend>

0 commit comments

Comments
 (0)