Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment for empty functions. #1438

Merged
merged 5 commits into from
Nov 7, 2024
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
5 changes: 4 additions & 1 deletion simulation/do_nothing_plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ auto interpolateEntityStatusFromPolylineTrajectory(
} // namespace follow_trajectory
} // namespace do_nothing_behavior

void DoNothingBehavior::configure(const rclcpp::Logger &) {}
void DoNothingBehavior::configure(const rclcpp::Logger &)
{
/// @note The do nothing plugin currently does not use rclcpp::Logger and the configure function is no operation.
}

void DoNothingBehavior::update(double current_time, double step_time)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,21 @@ class EntityBase

virtual void requestAssignRoute(const std::vector<geometry_msgs::msg::Pose> &) = 0;

virtual void requestLaneChange(const lanelet::Id) {}

virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &){};
virtual void requestLaneChange(const lanelet::Id)
{
/**
* @note There are Entities such as MiscObjectEntity for which lane change is not possible,
* and since it is necessary to implement appropriate overrides for each Entity, no operation is performed on the base type.
*/
}

virtual void requestLaneChange(const traffic_simulator::lane_change::Parameter &)
{
/**
* @note There are Entities such as MiscObjectEntity for which lane change is not possible,
* and since it is necessary to implement appropriate overrides for each Entity, no operation is performed on the base type.
*/
}

/* */ void requestLaneChange(
const lane_change::AbsoluteTarget &, const lane_change::TrajectoryShape,
Expand All @@ -164,7 +176,13 @@ class EntityBase

virtual void requestSpeedChange(const speed_change::RelativeTargetSpeed &, bool);

virtual void requestClearRoute() {}
virtual void requestClearRoute()
{
/**
* @note Since there are Entities such as MiscObjectEntity that do not perform routing,
* and routing methods differ from Entity to Entity, this function performs no operation in the base type.
*/
}

virtual auto isControlledBySimulator() const -> bool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,30 @@ class MiscObjectEntity : public EntityBase

void setBehaviorParameter(const traffic_simulator_msgs::msg::BehaviorParameter &) override;

void setVelocityLimit(double) override{};
void setVelocityLimit(double) override
{
/// @note Misc object entity does not move, so this function is no operation.
}

void setAccelerationLimit(double) override {}
void setAccelerationLimit(double) override
{
/// @note Misc object entity does not move, so this function is no operation.
}

void setAccelerationRateLimit(double) override {}
void setAccelerationRateLimit(double) override
{
/// @note Misc object entity does not move, so this function is no operation.
}

void setDecelerationLimit(double) override {}
void setDecelerationLimit(double) override
{
/// @note Misc object entity does not move, so this function is no operation.
}

void setDecelerationRateLimit(double) override {}
void setDecelerationRateLimit(double) override
{
/// @note Misc object entity does not move, so this function is no operation.
}

auto getMaxAcceleration() const -> double override
{
Expand Down
Loading