Skip to content

Commit

Permalink
Remove visibility macros (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagyar authored Dec 30, 2024
1 parent f23b7d8 commit a1d8da4
Show file tree
Hide file tree
Showing 69 changed files with 137 additions and 1,519 deletions.
10 changes: 5 additions & 5 deletions ackermann_steering_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.16)
project(ackermann_steering_controller LANGUAGES CXX)
project(ackermann_steering_controller)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
-Werror=missing-braces)
endif()

# using this instead of visibility macros
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# find dependencies
set(THIS_PACKAGE_INCLUDE_DEPENDS
controller_interface
Expand Down Expand Up @@ -45,10 +49,6 @@ target_link_libraries(ackermann_steering_controller PUBLIC
ackermann_steering_controller_parameters)
ament_target_dependencies(ackermann_steering_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(ackermann_steering_controller PRIVATE "ACKERMANN_STEERING_CONTROLLER__VISIBILITY_BUILDING_DLL")

pluginlib_export_plugin_description_file(
controller_interface ackermann_steering_controller.xml)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <memory>

#include "ackermann_steering_controller/visibility_control.h"
#include "ackermann_steering_controller_parameters.hpp"
#include "steering_controllers_library/steering_controllers_library.hpp"

Expand All @@ -47,14 +46,11 @@ class AckermannSteeringController : public steering_controllers_library::Steerin
public:
AckermannSteeringController();

ACKERMANN_STEERING_CONTROLLER__VISIBILITY_PUBLIC controller_interface::CallbackReturn
configure_odometry() override;
controller_interface::CallbackReturn configure_odometry() override;

ACKERMANN_STEERING_CONTROLLER__VISIBILITY_PUBLIC bool update_odometry(
const rclcpp::Duration & period) override;
bool update_odometry(const rclcpp::Duration & period) override;

ACKERMANN_STEERING_CONTROLLER__VISIBILITY_PUBLIC void
initialize_implementation_parameter_listener() override;
void initialize_implementation_parameter_listener() override;

protected:
std::shared_ptr<ackermann_steering_controller::ParamListener> ackermann_param_listener_;
Expand Down

This file was deleted.

10 changes: 5 additions & 5 deletions admittance_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.16)
project(admittance_controller LANGUAGES CXX)
project(admittance_controller)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
-Werror=missing-braces)
endif()

# using this instead of visibility macros
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

set(THIS_PACKAGE_INCLUDE_DEPENDS
angles
control_msgs
Expand Down Expand Up @@ -54,10 +58,6 @@ target_link_libraries(admittance_controller PUBLIC
)
ament_target_dependencies(admittance_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(admittance_controller PRIVATE "ADMITTANCE_CONTROLLER_BUILDING_DLL")

pluginlib_export_plugin_description_file(controller_interface admittance_controller.xml)

if(BUILD_TESTING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "admittance_controller_parameters.hpp"

#include "admittance_controller/admittance_rule.hpp"
#include "admittance_controller/visibility_control.h"
#include "control_msgs/msg/admittance_controller_state.hpp"
#include "controller_interface/chainable_controller_interface.hpp"
#include "hardware_interface/types/hardware_interface_type_values.hpp"
Expand All @@ -43,46 +42,37 @@ using ControllerStateMsg = control_msgs::msg::AdmittanceControllerState;
class AdmittanceController : public controller_interface::ChainableControllerInterface
{
public:
ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::CallbackReturn on_init() override;

/// Export configuration of required state interfaces.
/**
* Allowed types of state interfaces are \ref hardware_interface::POSITION,
* \ref hardware_interface::VELOCITY, \ref hardware_interface::ACCELERATION.
*/
ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::InterfaceConfiguration command_interface_configuration() const override;

/// Export configuration of required state interfaces.
/**
* Allowed types of state interfaces are \ref hardware_interface::POSITION,
* \ref hardware_interface::VELOCITY, \ref hardware_interface::ACCELERATION.
*/
ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::InterfaceConfiguration state_interface_configuration() const override;

ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::CallbackReturn on_configure(
const rclcpp_lifecycle::State & previous_state) override;

ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::CallbackReturn on_activate(
const rclcpp_lifecycle::State & previous_state) override;

ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::CallbackReturn on_deactivate(
const rclcpp_lifecycle::State & previous_state) override;

ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::CallbackReturn on_cleanup(
const rclcpp_lifecycle::State & previous_state) override;

ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::CallbackReturn on_error(
const rclcpp_lifecycle::State & previous_state) override;

ADMITTANCE_CONTROLLER_PUBLIC
controller_interface::return_type update_and_write_commands(
const rclcpp::Time & time, const rclcpp::Duration & period) override;

Expand Down

This file was deleted.

10 changes: 5 additions & 5 deletions bicycle_steering_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.16)
project(bicycle_steering_controller LANGUAGES CXX)
project(bicycle_steering_controller)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
-Werror=missing-braces)
endif()

# using this instead of visibility macros
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# find dependencies
set(THIS_PACKAGE_INCLUDE_DEPENDS
controller_interface
Expand Down Expand Up @@ -45,10 +49,6 @@ target_link_libraries(bicycle_steering_controller PUBLIC
bicycle_steering_controller_parameters)
ament_target_dependencies(bicycle_steering_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(bicycle_steering_controller PRIVATE "BICYCLE_STEERING_CONTROLLER__VISIBILITY_BUILDING_DLL")

pluginlib_export_plugin_description_file(
controller_interface bicycle_steering_controller.xml)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <memory>

#include "bicycle_steering_controller/visibility_control.h"
#include "bicycle_steering_controller_parameters.hpp"
#include "steering_controllers_library/steering_controllers_library.hpp"

Expand All @@ -43,14 +42,11 @@ class BicycleSteeringController : public steering_controllers_library::SteeringC
public:
BicycleSteeringController();

BICYCLE_STEERING_CONTROLLER__VISIBILITY_PUBLIC controller_interface::CallbackReturn
configure_odometry() override;
controller_interface::CallbackReturn configure_odometry() override;

BICYCLE_STEERING_CONTROLLER__VISIBILITY_PUBLIC bool update_odometry(
const rclcpp::Duration & period) override;
bool update_odometry(const rclcpp::Duration & period) override;

BICYCLE_STEERING_CONTROLLER__VISIBILITY_PUBLIC void initialize_implementation_parameter_listener()
override;
void initialize_implementation_parameter_listener() override;

protected:
std::shared_ptr<bicycle_steering_controller::ParamListener> bicycle_param_listener_;
Expand Down

This file was deleted.

9 changes: 5 additions & 4 deletions diff_drive_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.16)
project(diff_drive_controller LANGUAGES CXX)
project(diff_drive_controller)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
-Werror=missing-braces)
endif()

# using this instead of visibility macros
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

set(THIS_PACKAGE_INCLUDE_DEPENDS
control_toolbox
controller_interface
Expand Down Expand Up @@ -49,9 +53,6 @@ target_link_libraries(diff_drive_controller
PUBLIC
diff_drive_controller_parameters)
ament_target_dependencies(diff_drive_controller PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(diff_drive_controller PRIVATE "DIFF_DRIVE_CONTROLLER_BUILDING_DLL")
pluginlib_export_plugin_description_file(controller_interface diff_drive_plugin.xml)

if(BUILD_TESTING)
Expand Down
Loading

0 comments on commit a1d8da4

Please sign in to comment.