Skip to content
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
11 changes: 3 additions & 8 deletions gz_ros2_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
cmake_minimum_required(VERSION 3.5)
project(gz_ros2_control)

# Default to C11
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
find_package(ros2_control_cmake REQUIRED)
set_compiler_options()
export_windows_symbols()

# Compiler options
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
4 changes: 3 additions & 1 deletion gz_ros2_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
<depend>rclcpp</depend>
<depend>yaml_cpp_vendor</depend>
<depend>rclcpp_lifecycle</depend>
<depend>hardware_interface</depend>

<depend>controller_manager</depend>
<depend>hardware_interface</depend>
<depend>ros2_control_cmake</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
16 changes: 8 additions & 8 deletions gz_ros2_control/src/gz_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,12 @@ void GazeboSimROS2ControlPlugin::Configure(

auto sdfPtr = const_cast<sdf::Element *>(_sdf.get());

sdf::ElementPtr argument_sdf = sdfPtr->GetElement("parameters");
while (argument_sdf) {
std::string argument = argument_sdf->Get<std::string>();
sdf::ElementPtr argument_sdf_param = sdfPtr->GetElement("parameters");
while (argument_sdf_param) {
std::string argument = argument_sdf_param->Get<std::string>();
arguments.push_back(RCL_PARAM_FILE_FLAG);
arguments.push_back(argument);
argument_sdf = argument_sdf->GetNextElement("parameters");
argument_sdf_param = argument_sdf_param->GetNextElement("parameters");
}

// Get controller manager node name
Expand Down Expand Up @@ -335,14 +335,14 @@ void GazeboSimROS2ControlPlugin::Configure(

// Get list of remapping rules from SDF
if (sdfRos->HasElement("remapping")) {
sdf::ElementPtr argument_sdf = sdfRos->GetElement("remapping");
sdf::ElementPtr argument_sdf_remapping = sdfRos->GetElement("remapping");

arguments.push_back(RCL_ROS_ARGS_FLAG);
while (argument_sdf) {
std::string argument = argument_sdf->Get<std::string>();
while (argument_sdf_remapping) {
std::string argument = argument_sdf_remapping->Get<std::string>();
arguments.push_back(RCL_REMAP_FLAG);
arguments.push_back(argument);
argument_sdf = argument_sdf->GetNextElement("remapping");
argument_sdf_remapping = argument_sdf_remapping->GetNextElement("remapping");
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions gz_ros2_control_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
cmake_minimum_required(VERSION 3.5.0)
project(gz_ros2_control_demos)

# Default to C11
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
find_package(ros2_control_cmake REQUIRED)
set_compiler_options()
export_windows_symbols()

if(NOT WIN32)
add_compile_options(-Wall -Wextra -Wpedantic)
Expand Down
3 changes: 2 additions & 1 deletion gz_ros2_control_demos/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<exec_depend>xacro</exec_depend>

<!-- ros2_control -->
<depend>ros2_control_cmake</depend>
<exec_depend>ackermann_steering_controller</exec_depend>
<exec_depend>control_msgs</exec_depend>
<exec_depend>diff_drive_controller</exec_depend>
Expand All @@ -46,7 +47,7 @@
<exec_depend>joint_trajectory_controller</exec_depend>
<exec_depend>mecanum_drive_controller</exec_depend>
<exec_depend>ros2controlcli</exec_depend>
<exec_depend>tricycle_controller</exec_depend>
<exec_depend>tricycle_steering_controller</exec_depend>
<exec_depend>velocity_controllers</exec_depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down
Loading