College of DuPage Lunabotics Documentation  2025
ExcavationServer Class Reference

Performs excavation sequence after receiving request from the navigation client. More...

Inheritance diagram for ExcavationServer:
Collaboration diagram for ExcavationServer:

Public Types

using Excavation = lunabot_msgs::action::Excavation
 
using GoalHandleExcavation = rclcpp_action::ServerGoalHandle< Excavation >
 

Public Member Functions

 ExcavationServer ()
 Constructor for the ExcavationServer class. More...
 

Private Member Functions

rclcpp_action::GoalResponse handle_goal (const rclcpp_action::GoalUUID &, std::shared_ptr< const Excavation::Goal >)
 Handles goal requests from clients. More...
 
rclcpp_action::CancelResponse handle_cancel (const std::shared_ptr< GoalHandleExcavation >)
 Handles cancellation requests from clients. More...
 
void handle_accepted (const std::shared_ptr< GoalHandleExcavation > goal_handle)
 Accepts and starts the goal execution. More...
 
void execute (const std::shared_ptr< GoalHandleExcavation > goal_handle)
 Executes the Excavation process. More...
 
void odometry_callback (const nav_msgs::msg::Odometry::SharedPtr msg)
 Callback for the odometry message. More...
 
void excavate ()
 Uses current odometry and compares to goal to navigate the robot to the construction zone. More...
 
double normalize_angle (double angle)
 Normalizes an angle to the range [-pi, pi]. More...
 

Private Attributes

rclcpp_action::Server< Excavation >::SharedPtr action_server_
 
rclcpp::Publisher< geometry_msgs::msg::Twist >::SharedPtr cmd_vel_publisher_
 
rclcpp::Subscription< nav_msgs::msg::Odometry >::SharedPtr odometry_subscriber_
 
rclcpp::TimerBase::SharedPtr odometry_timer_
 
rclcpp::TimerBase::SharedPtr excavation_timer_
 
rclcpp::Time previous_time_
 
bool success_
 
bool goal_active_
 
bool alignment_done_
 
double current_x_
 
double current_y_
 
double current_roll_
 
double current_pitch_
 
double current_yaw_
 
double previous_error_
 
double error_sum_
 

Detailed Description

Performs excavation sequence after receiving request from the navigation client.

Member Typedef Documentation

◆ Excavation

using ExcavationServer::Excavation = lunabot_msgs::action::Excavation

◆ GoalHandleExcavation

using ExcavationServer::GoalHandleExcavation = rclcpp_action::ServerGoalHandle<Excavation>

Constructor & Destructor Documentation

◆ ExcavationServer()

ExcavationServer::ExcavationServer ( )
inline

Constructor for the ExcavationServer class.

Member Function Documentation

◆ excavate()

void ExcavationServer::excavate ( )
inlineprivate

Uses current odometry and compares to goal to navigate the robot to the construction zone.

◆ execute()

void ExcavationServer::execute ( const std::shared_ptr< GoalHandleExcavation goal_handle)
inlineprivate

Executes the Excavation process.

Parameters
goal_handleHandle for the current goal.

◆ handle_accepted()

void ExcavationServer::handle_accepted ( const std::shared_ptr< GoalHandleExcavation goal_handle)
inlineprivate

Accepts and starts the goal execution.

Parameters
goal_handleHandle for the current goal.

◆ handle_cancel()

rclcpp_action::CancelResponse ExcavationServer::handle_cancel ( const std::shared_ptr< GoalHandleExcavation )
inlineprivate

Handles cancellation requests from clients.

Returns
Cancel response (accept or reject).

◆ handle_goal()

rclcpp_action::GoalResponse ExcavationServer::handle_goal ( const rclcpp_action::GoalUUID &  ,
std::shared_ptr< const Excavation::Goal >   
)
inlineprivate

Handles goal requests from clients.

Returns
Goal response (accept or reject).

◆ normalize_angle()

double ExcavationServer::normalize_angle ( double  angle)
inlineprivate

Normalizes an angle to the range [-pi, pi].

Parameters
angleThe angle to normalize.
Returns
Normalized angle.

◆ odometry_callback()

void ExcavationServer::odometry_callback ( const nav_msgs::msg::Odometry::SharedPtr  msg)
inlineprivate

Callback for the odometry message.

Parameters
msgThe odometry message.

Member Data Documentation

◆ action_server_

rclcpp_action::Server<Excavation>::SharedPtr ExcavationServer::action_server_
private

◆ alignment_done_

bool ExcavationServer::alignment_done_
private

◆ cmd_vel_publisher_

rclcpp::Publisher<geometry_msgs::msg::Twist>::SharedPtr ExcavationServer::cmd_vel_publisher_
private

◆ current_pitch_

double ExcavationServer::current_pitch_
private

◆ current_roll_

double ExcavationServer::current_roll_
private

◆ current_x_

double ExcavationServer::current_x_
private

◆ current_y_

double ExcavationServer::current_y_
private

◆ current_yaw_

double ExcavationServer::current_yaw_
private

◆ error_sum_

double ExcavationServer::error_sum_
private

◆ excavation_timer_

rclcpp::TimerBase::SharedPtr ExcavationServer::excavation_timer_
private

◆ goal_active_

bool ExcavationServer::goal_active_
private

◆ odometry_subscriber_

rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr ExcavationServer::odometry_subscriber_
private

◆ odometry_timer_

rclcpp::TimerBase::SharedPtr ExcavationServer::odometry_timer_
private

◆ previous_error_

double ExcavationServer::previous_error_
private

◆ previous_time_

rclcpp::Time ExcavationServer::previous_time_
private

◆ success_

bool ExcavationServer::success_
private

The documentation for this class was generated from the following file: