Skip to content

Commit

Permalink
fix(traffic_simulator): revert clang changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoszynski committed Dec 10, 2024
1 parent b214474 commit bb0a6bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ void toMsg(const rosgraph_msgs::Clock & proto, rosgraph_msgs::msg::Clock & time)
void toProto(const std_msgs::msg::Header & header, std_msgs::Header & proto);
void toMsg(const std_msgs::Header & proto, std_msgs::msg::Header & header);

#define DEFINE_CONVERSION(PACKAGE, TYPENAME) \
auto toProto(const PACKAGE::msg::TYPENAME &, PACKAGE::TYPENAME &) -> void; \
auto toMsg(const PACKAGE::TYPENAME &, PACKAGE::msg::TYPENAME &) -> void
#define DEFINE_CONVERSION(PACKAGE, TYPENAME) \
auto toProto(const PACKAGE::msg::TYPENAME &, PACKAGE::TYPENAME &)->void; \
auto toMsg(const PACKAGE::TYPENAME &, PACKAGE::msg::TYPENAME &)->void

DEFINE_CONVERSION(autoware_control_msgs, Lateral);
DEFINE_CONVERSION(autoware_control_msgs, Longitudinal);
Expand All @@ -190,7 +190,8 @@ auto toMsg(
{
using namespace simulation_api_schema;

auto convert_color = [](auto color) constexpr {
auto convert_color = [](auto color) constexpr
{
switch (color) {
case TrafficLight_Color_RED:
return TrafficLightBulbMessageType::RED;
Expand All @@ -205,7 +206,8 @@ auto toMsg(
}
};

auto convert_shape = [](auto shape) constexpr {
auto convert_shape = [](auto shape) constexpr
{
switch (shape) {
case TrafficLight_Shape_CIRCLE:
return TrafficLightBulbMessageType::CIRCLE;
Expand Down Expand Up @@ -233,7 +235,8 @@ auto toMsg(
}
};

auto convert_status = [](auto status) constexpr {
auto convert_status = [](auto status) constexpr
{
switch (status) {
case TrafficLight_Status_SOLID_OFF:
return TrafficLightBulbMessageType::SOLID_OFF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class BehaviorPluginBase
virtual auto update(const double current_time, const double step_time) -> void = 0;
virtual const std::string & getCurrentAction() const = 0;

#define DEFINE_GETTER_SETTER(NAME, KEY, TYPE) \
virtual TYPE get##NAME() = 0; \
virtual void set##NAME(const TYPE & value) = 0; \
auto get##NAME##Key() const -> const std::string & \
{ \
static const std::string key = KEY; \
return key; \
#define DEFINE_GETTER_SETTER(NAME, KEY, TYPE) \
virtual TYPE get##NAME() = 0; \
virtual void set##NAME(const TYPE & value) = 0; \
auto get##NAME##Key() const->const std::string & \
{ \
static const std::string key = KEY; \
return key; \
}

// clang-format off
Expand Down

0 comments on commit bb0a6bf

Please sign in to comment.