Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Oct 21, 2024
1 parent 11dbeef commit d9a495b
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ class OperationModeTransitionManager : public rclcpp::Node
private:
using ChangeAutowareControlAPI =
autoware::component_interface_specs::system::ChangeAutowareControl;
using ChangeOperationModeAPI =
autoware::component_interface_specs::system::ChangeOperationMode;
using OperationModeStateAPI =
autoware::component_interface_specs::system::OperationModeState;
using ChangeOperationModeAPI = autoware::component_interface_specs::system::ChangeOperationMode;
using OperationModeStateAPI = autoware::component_interface_specs::system::OperationModeState;
component_interface_utils::Service<ChangeAutowareControlAPI>::SharedPtr srv_autoware_control_;
component_interface_utils::Service<ChangeOperationModeAPI>::SharedPtr srv_operation_mode_;
component_interface_utils::Publisher<OperationModeStateAPI>::SharedPtr pub_operation_mode_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class PredictedPathCheckerNode : public rclcpp::Node
PredictedObjects::ConstSharedPtr object_ptr_{nullptr};
autoware_planning_msgs::msg::Trajectory::ConstSharedPtr reference_trajectory_;
autoware_planning_msgs::msg::Trajectory::ConstSharedPtr predicted_trajectory_;
autoware::component_interface_specs::control::IsStopped::Message::ConstSharedPtr
is_stopped_ptr_{nullptr};
autoware::component_interface_specs::control::IsStopped::Message::ConstSharedPtr is_stopped_ptr_{
nullptr};

// Core
std::unique_ptr<CollisionChecker> collision_checker_;
Expand All @@ -130,8 +130,7 @@ class PredictedPathCheckerNode : public rclcpp::Node
void onOdom(const nav_msgs::msg::Odometry::SharedPtr msg);
void onAccel(const geometry_msgs::msg::AccelWithCovarianceStamped::SharedPtr msg);
void onIsStopped(
const autoware::component_interface_specs::control::IsStopped::Message::ConstSharedPtr
msg);
const autoware::component_interface_specs::control::IsStopped::Message::ConstSharedPtr msg);

// Timer
rclcpp::TimerBase::SharedPtr timer_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ void PredictedPathCheckerNode::onAccel(
}

void PredictedPathCheckerNode::onIsStopped(
const autoware::component_interface_specs::control::IsStopped::Message::ConstSharedPtr
msg)
const autoware::component_interface_specs::control::IsStopped::Message::ConstSharedPtr msg)
{
is_stopped_ptr_ = msg;

Expand Down Expand Up @@ -416,8 +415,8 @@ void PredictedPathCheckerNode::checkVehicleState(diagnostic_updater::DiagnosticS
void PredictedPathCheckerNode::sendRequest(bool make_stop_vehicle)
{
if (!is_calling_set_stop_ && cli_set_stop_->service_is_ready()) {
const auto req = std::make_shared<
autoware::component_interface_specs::control::SetStop::Service::Request>();
const auto req =
std::make_shared<autoware::component_interface_specs::control::SetStop::Service::Request>();
req->stop = make_stop_vehicle;
req->request_source = "predicted_path_checker";
is_calling_set_stop_ = true;
Expand Down
10 changes: 4 additions & 6 deletions system/autoware_default_adapi/src/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ void MotionNode::update_pause(const State state)
void MotionNode::change_pause(bool pause)
{
if (!is_calling_set_pause_ && cli_set_pause_->service_is_ready()) {
const auto req = std::make_shared<
autoware::component_interface_specs::control::SetPause::Service::Request>();
const auto req =
std::make_shared<autoware::component_interface_specs::control::SetPause::Service::Request>();
req->pause = pause;
is_calling_set_pause_ = true;
cli_set_pause_->async_send_request(req, [this](auto) { is_calling_set_pause_ = false; });
Expand All @@ -135,16 +135,14 @@ void MotionNode::on_timer()
}

void MotionNode::on_is_paused(

Check warning on line 137 in system/autoware_default_adapi/src/motion.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_default_adapi/src/motion.cpp#L137

Added line #L137 was not covered by tests
const autoware::component_interface_specs::control::IsPaused::Message::ConstSharedPtr
msg)
const autoware::component_interface_specs::control::IsPaused::Message::ConstSharedPtr msg)
{
is_paused_ = msg->data;
update_state();
}

void MotionNode::on_is_start_requested(
const autoware::component_interface_specs::control::IsStartRequested::Message::
ConstSharedPtr msg)
const autoware::component_interface_specs::control::IsStartRequested::Message::ConstSharedPtr msg)
{
is_start_requested_ = msg->data;
update_state();
Expand Down
9 changes: 4 additions & 5 deletions system/autoware_default_adapi/src/motion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class MotionNode : public rclcpp::Node
Pub<autoware_ad_api::motion::State> pub_state_;
Cli<autoware::component_interface_specs::control::SetPause> cli_set_pause_;
Sub<autoware::component_interface_specs::control::IsPaused> sub_is_paused_;
Sub<autoware::component_interface_specs::control::IsStartRequested>
sub_is_start_requested_;
Sub<autoware::component_interface_specs::control::IsStartRequested> sub_is_start_requested_;

enum class State { Unknown, Pausing, Paused, Starting, Resuming, Resumed, Moving };
State state_;
Expand All @@ -59,10 +58,10 @@ class MotionNode : public rclcpp::Node
void change_pause(bool pause);
void on_timer();
void on_is_paused(
const autoware::component_interface_specs::control::IsPaused::Message::ConstSharedPtr
const autoware::component_interface_specs::control::IsPaused::Message::ConstSharedPtr msg);
void on_is_start_requested(
const autoware::component_interface_specs::control::IsStartRequested::Message::ConstSharedPtr
msg);
void on_is_start_requested(const autoware::component_interface_specs::control::
IsStartRequested::Message::ConstSharedPtr msg);
void on_accept(
const autoware_ad_api::motion::AcceptStart::Service::Request::SharedPtr req,
const autoware_ad_api::motion::AcceptStart::Service::Response::SharedPtr res);
Expand Down
4 changes: 2 additions & 2 deletions system/autoware_default_adapi/src/perception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ uint8_t PerceptionNode::mapping(
}

void PerceptionNode::object_recognize(
const autoware::component_interface_specs::perception::ObjectRecognition::Message::
ConstSharedPtr msg)
const autoware::component_interface_specs::perception::ObjectRecognition::Message::ConstSharedPtr
msg)
{
DynamicObjectArray::Message objects;
objects.header = msg->header;
Expand Down
7 changes: 3 additions & 4 deletions system/autoware_default_adapi/src/perception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ class PerceptionNode : public rclcpp::Node

private:
Pub<autoware_ad_api::perception::DynamicObjectArray> pub_object_recognized_;
Sub<autoware::component_interface_specs::perception::ObjectRecognition>
sub_object_recognized_;
void object_recognize(const autoware::component_interface_specs::perception::
ObjectRecognition::Message::ConstSharedPtr msg);
Sub<autoware::component_interface_specs::perception::ObjectRecognition> sub_object_recognized_;
void object_recognize(const autoware::component_interface_specs::perception::ObjectRecognition::
Message::ConstSharedPtr msg);
uint8_t mapping(
std::unordered_map<uint8_t, uint8_t> hash_map, uint8_t input, uint8_t default_value);
};
Expand Down
6 changes: 2 additions & 4 deletions system/autoware_default_adapi/src/planning.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class PlanningNode : public rclcpp::Node
Pub<autoware_ad_api::planning::VelocityFactors> pub_velocity_factors_;
Pub<autoware_ad_api::planning::SteeringFactors> pub_steering_factors_;
Sub<autoware::component_interface_specs::planning::Trajectory> sub_trajectory_;
Sub<autoware::component_interface_specs::localization::KinematicState>
sub_kinematic_state_;
Sub<autoware::component_interface_specs::localization::KinematicState> sub_kinematic_state_;
std::vector<rclcpp::Subscription<VelocityFactorArray>::SharedPtr> sub_velocity_factors_;
std::vector<rclcpp::Subscription<SteeringFactorArray>::SharedPtr> sub_steering_factors_;
std::vector<VelocityFactorArray::ConstSharedPtr> velocity_factors_;
Expand All @@ -51,8 +50,7 @@ class PlanningNode : public rclcpp::Node

using VehicleStopChecker = autoware::motion_utils::VehicleStopCheckerBase;
using Trajectory = autoware::component_interface_specs::planning::Trajectory::Message;
using KinematicState =
autoware::component_interface_specs::localization::KinematicState::Message;
using KinematicState = autoware::component_interface_specs::localization::KinematicState::Message;
void on_trajectory(const Trajectory::ConstSharedPtr msg);
void on_kinematic_state(const KinematicState::ConstSharedPtr msg);
void on_timer();
Expand Down
15 changes: 5 additions & 10 deletions system/autoware_default_adapi/src/routing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class RoutingNode : public rclcpp::Node
explicit RoutingNode(const rclcpp::NodeOptions & options);

private:
using OperationModeState =
autoware::component_interface_specs::system::OperationModeState;
using OperationModeState = autoware::component_interface_specs::system::OperationModeState;
using State = autoware::component_interface_specs::planning::RouteState;
using Route = autoware::component_interface_specs::planning::LaneletRoute;

Expand All @@ -48,15 +47,11 @@ class RoutingNode : public rclcpp::Node
Srv<autoware_ad_api::routing::ClearRoute> srv_clear_route_;
Sub<autoware::component_interface_specs::planning::RouteState> sub_state_;
Sub<autoware::component_interface_specs::planning::LaneletRoute> sub_route_;
Cli<autoware::component_interface_specs::planning::SetWaypointRoute>
cli_set_waypoint_route_;
Cli<autoware::component_interface_specs::planning::SetLaneletRoute>
cli_set_lanelet_route_;
Cli<autoware::component_interface_specs::planning::SetWaypointRoute> cli_set_waypoint_route_;
Cli<autoware::component_interface_specs::planning::SetLaneletRoute> cli_set_lanelet_route_;
Cli<autoware::component_interface_specs::planning::ClearRoute> cli_clear_route_;
Cli<autoware::component_interface_specs::system::ChangeOperationMode>
cli_operation_mode_;
Sub<autoware::component_interface_specs::system::OperationModeState>
sub_operation_mode_;
Cli<autoware::component_interface_specs::system::ChangeOperationMode> cli_operation_mode_;
Sub<autoware::component_interface_specs::system::OperationModeState> sub_operation_mode_;
bool is_auto_mode_;
State::Message state_;

Expand Down
23 changes: 11 additions & 12 deletions system/autoware_default_adapi/src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ using ApiGear = autoware_adapi_v1_msgs::msg::Gear;
using TurnIndicatorsReport =
autoware::component_interface_specs::vehicle::TurnIndicatorStatus::Message;
using ApiTurnIndicator = autoware_adapi_v1_msgs::msg::TurnIndicators;
using HazardLightsReport =
autoware::component_interface_specs::vehicle::HazardLightStatus::Message;
using HazardLightsReport = autoware::component_interface_specs::vehicle::HazardLightStatus::Message;
using ApiHazardLight = autoware_adapi_v1_msgs::msg::HazardLights;
using MapProjectorInfo =
autoware::component_interface_specs::map::MapProjectorInfo::Message;
using MapProjectorInfo = autoware::component_interface_specs::map::MapProjectorInfo::Message;

std::unordered_map<uint8_t, uint8_t> gear_type_ = {
{GearReport::NONE, ApiGear::UNKNOWN}, {GearReport::NEUTRAL, ApiGear::NEUTRAL},
Expand Down Expand Up @@ -92,21 +90,22 @@ uint8_t VehicleNode::mapping(
}

void VehicleNode::kinematic_state(
const autoware::component_interface_specs::localization::KinematicState::Message::
ConstSharedPtr msg_ptr)
const autoware::component_interface_specs::localization::KinematicState::Message::ConstSharedPtr
msg_ptr)
{
kinematic_state_msgs_ = msg_ptr;
}

void VehicleNode::acceleration_status(
const autoware::component_interface_specs::localization::Acceleration::Message::
ConstSharedPtr msg_ptr)
const autoware::component_interface_specs::localization::Acceleration::Message::ConstSharedPtr
msg_ptr)
{
acceleration_msgs_ = msg_ptr;
}

void VehicleNode::steering_status(const autoware::component_interface_specs::vehicle::
SteeringStatus::Message::ConstSharedPtr msg_ptr)
void VehicleNode::steering_status(
const autoware::component_interface_specs::vehicle::SteeringStatus::Message::ConstSharedPtr
msg_ptr)
{
steering_status_msgs_ = msg_ptr;
}
Expand All @@ -126,8 +125,8 @@ void VehicleNode::hazard_light_status(const HazardLightsReport::ConstSharedPtr m
hazard_light_status_msgs_ = msg_ptr;
}

void VehicleNode::energy_status(const autoware::component_interface_specs::vehicle::
EnergyStatus::Message::ConstSharedPtr msg_ptr)
void VehicleNode::energy_status(
const autoware::component_interface_specs::vehicle::EnergyStatus::Message::ConstSharedPtr msg_ptr)
{
energy_status_msgs_ = msg_ptr;
}
Expand Down
54 changes: 30 additions & 24 deletions system/autoware_default_adapi/src/vehicle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,51 +42,57 @@ class VehicleNode : public rclcpp::Node
rclcpp::CallbackGroup::SharedPtr group_cli_;
Pub<autoware_ad_api::vehicle::VehicleKinematics> pub_kinematics_;
Pub<autoware_ad_api::vehicle::VehicleStatus> pub_status_;
Sub<autoware::component_interface_specs::localization::KinematicState>
sub_kinematic_state_;
Sub<autoware::component_interface_specs::localization::KinematicState> sub_kinematic_state_;
Sub<autoware::component_interface_specs::localization::Acceleration> sub_acceleration_;
Sub<autoware::component_interface_specs::vehicle::SteeringStatus> sub_steering_;
Sub<autoware::component_interface_specs::vehicle::GearStatus> sub_gear_state_;
Sub<autoware::component_interface_specs::vehicle::TurnIndicatorStatus>
sub_turn_indicator_;
Sub<autoware::component_interface_specs::vehicle::TurnIndicatorStatus> sub_turn_indicator_;
Sub<autoware::component_interface_specs::vehicle::HazardLightStatus> sub_hazard_light_;
Sub<autoware::component_interface_specs::vehicle::EnergyStatus> sub_energy_level_;
Sub<autoware::component_interface_specs::map::MapProjectorInfo> sub_map_projector_info_;
rclcpp::TimerBase::SharedPtr timer_;

autoware::component_interface_specs::localization::KinematicState::Message::
ConstSharedPtr kinematic_state_msgs_;
autoware::component_interface_specs::localization::KinematicState::Message::ConstSharedPtr
kinematic_state_msgs_;
autoware::component_interface_specs::localization::Acceleration::Message::ConstSharedPtr
acceleration_msgs_;
autoware::component_interface_specs::vehicle::SteeringStatus::Message::ConstSharedPtr
steering_status_msgs_;
autoware::component_interface_specs::vehicle::GearStatus::Message::ConstSharedPtr
gear_status_msgs_;
autoware::component_interface_specs::vehicle::TurnIndicatorStatus::Message::
ConstSharedPtr turn_indicator_status_msgs_;
autoware::component_interface_specs::vehicle::TurnIndicatorStatus::Message::ConstSharedPtr
turn_indicator_status_msgs_;
autoware::component_interface_specs::vehicle::HazardLightStatus::Message::ConstSharedPtr
hazard_light_status_msgs_;
autoware::component_interface_specs::vehicle::EnergyStatus::Message::ConstSharedPtr
energy_status_msgs_;
autoware::component_interface_specs::map::MapProjectorInfo::Message::ConstSharedPtr
map_projector_info_;

void kinematic_state(const autoware::component_interface_specs::localization::
KinematicState::Message::ConstSharedPtr msg_ptr);
void acceleration_status(const autoware::component_interface_specs::localization::
Acceleration::Message::ConstSharedPtr msg_ptr);
void steering_status(const autoware::component_interface_specs::vehicle::
SteeringStatus::Message::ConstSharedPtr msg_ptr);
void gear_status(const autoware::component_interface_specs::vehicle::GearStatus::
Message::ConstSharedPtr msg_ptr);
void turn_indicator_status(const autoware::component_interface_specs::vehicle::
TurnIndicatorStatus::Message::ConstSharedPtr msg_ptr);
void map_projector_info(const autoware::component_interface_specs::map::
MapProjectorInfo::Message::ConstSharedPtr msg_ptr);
void hazard_light_status(const autoware::component_interface_specs::vehicle::
HazardLightStatus::Message::ConstSharedPtr msg_ptr);
void energy_status(const autoware::component_interface_specs::vehicle::EnergyStatus::
Message::ConstSharedPtr msg_ptr);
void kinematic_state(
const autoware::component_interface_specs::localization::KinematicState::Message::ConstSharedPtr
msg_ptr);
void acceleration_status(
const autoware::component_interface_specs::localization::Acceleration::Message::ConstSharedPtr
msg_ptr);
void steering_status(
const autoware::component_interface_specs::vehicle::SteeringStatus::Message::ConstSharedPtr
msg_ptr);
void gear_status(
const autoware::component_interface_specs::vehicle::GearStatus::Message::ConstSharedPtr
msg_ptr);
void turn_indicator_status(
const autoware::component_interface_specs::vehicle::TurnIndicatorStatus::Message::ConstSharedPtr
msg_ptr);
void map_projector_info(
const autoware::component_interface_specs::map::MapProjectorInfo::Message::ConstSharedPtr
msg_ptr);
void hazard_light_status(
const autoware::component_interface_specs::vehicle::HazardLightStatus::Message::ConstSharedPtr
msg_ptr);
void energy_status(
const autoware::component_interface_specs::vehicle::EnergyStatus::Message::ConstSharedPtr
msg_ptr);
uint8_t mapping(
std::unordered_map<uint8_t, uint8_t> hash_map, uint8_t input, uint8_t default_value);
void publish_kinematics();
Expand Down
3 changes: 1 addition & 2 deletions system/autoware_default_adapi/src/vehicle_door.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ void VehicleDoorNode::on_status(
{
utils::notify(
pub_status_, status_, *msg,

Check warning on line 37 in system/autoware_default_adapi/src/vehicle_door.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_default_adapi/src/vehicle_door.cpp#L37

Added line #L37 was not covered by tests
utils::ignore_stamp<
autoware::component_interface_specs::vehicle::DoorStatus::Message>);
utils::ignore_stamp<autoware::component_interface_specs::vehicle::DoorStatus::Message>);
}

} // namespace autoware::default_adapi
Expand Down
6 changes: 2 additions & 4 deletions system/autoware_default_adapi/src/vehicle_door.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@ class VehicleDoorNode : public rclcpp::Node

private:
void on_status(
autoware::component_interface_specs::vehicle::DoorStatus::Message::ConstSharedPtr
msg);
autoware::component_interface_specs::vehicle::DoorStatus::Message::ConstSharedPtr msg);
rclcpp::CallbackGroup::SharedPtr group_cli_;
Srv<autoware_ad_api::vehicle::DoorCommand> srv_command_;
Srv<autoware_ad_api::vehicle::DoorLayout> srv_layout_;
Pub<autoware_ad_api::vehicle::DoorStatus> pub_status_;
Cli<autoware::component_interface_specs::vehicle::DoorCommand> cli_command_;
Cli<autoware::component_interface_specs::vehicle::DoorLayout> cli_layout_;
Sub<autoware::component_interface_specs::vehicle::DoorStatus> sub_status_;
std::optional<autoware::component_interface_specs::vehicle::DoorStatus::Message>
status_;
std::optional<autoware::component_interface_specs::vehicle::DoorStatus::Message> status_;
};

} // namespace autoware::default_adapi
Expand Down

0 comments on commit d9a495b

Please sign in to comment.