College of DuPage Lunabotics Documentation  2025
ControllerTeleop Class Reference

Controls the robot physically via manual and autonomous commands using various controllers. More...

Inheritance diagram for ControllerTeleop:
Collaboration diagram for ControllerTeleop:

Public Member Functions

 ControllerTeleop ()
 

Private Member Functions

void declare_and_get_parameters ()
 Declares and retrieves controller mode parameters. More...
 
void apply_controller_mode ()
 Applies the correct controller mode based on parameters. More...
 
void control_robot ()
 Controls the robot based on joystick input. More...
 
void joy_callback (const sensor_msgs::msg::Joy::SharedPtr joy_msg)
 Joystick input processing. More...
 
void velocity_callback (const geometry_msgs::msg::Twist::SharedPtr velocity_msg)
 Velocity message callback for navigation control. More...
 
int get_button (const sensor_msgs::msg::Joy::SharedPtr &joy_msg, const std::initializer_list< int > &mappings)
 Helper to retrieve button value based on controller mode. More...
 
double get_axis (const sensor_msgs::msg::Joy::SharedPtr &joy_msg, const std::initializer_list< int > &mappings)
 Helper to retrieve axis value based on controller mode. More...
 

Private Attributes

rclcpp::Subscription< geometry_msgs::msg::Twist >::SharedPtr velocity_subscriber_
 
rclcpp::Subscription< sensor_msgs::msg::Joy >::SharedPtr joystick_subscriber_
 
bool manual_enabled_
 
bool robot_disabled_
 
bool xbox_mode_
 
bool ps4_mode_
 
bool switch_mode_
 
bool outdoor_mode_
 
double speed_multiplier_
 
double left_speed_
 
double right_speed_
 
double lift_actuator_speed_
 
double tilt_actuator_speed_
 
bool home_button_
 
bool share_button_
 
bool menu_button_
 
bool a_button_
 
bool b_button_
 
bool x_button_
 
bool y_button_
 
double left_trigger_
 
double right_trigger_
 
double left_bumper_
 
double right_bumper_
 
double d_pad_vertical_
 
double d_pad_horizontal_
 
double left_joystick_x_
 
double left_joystick_y_
 
double right_joystick_y_
 
SparkMax left_wheel_motor_
 
SparkMax right_wheel_motor_
 
SparkMax lift_actuator_motor_
 
SparkMax tilt_actuator_left_motor_
 
SparkMax tilt_actuator_right_motor_
 

Detailed Description

Controls the robot physically via manual and autonomous commands using various controllers.

Constructor & Destructor Documentation

◆ ControllerTeleop()

ControllerTeleop::ControllerTeleop ( )
inline

Member Function Documentation

◆ apply_controller_mode()

void ControllerTeleop::apply_controller_mode ( )
inlineprivate

Applies the correct controller mode based on parameters.

◆ control_robot()

void ControllerTeleop::control_robot ( )
inlineprivate

Controls the robot based on joystick input.

◆ declare_and_get_parameters()

void ControllerTeleop::declare_and_get_parameters ( )
inlineprivate

Declares and retrieves controller mode parameters.

◆ get_axis()

double ControllerTeleop::get_axis ( const sensor_msgs::msg::Joy::SharedPtr &  joy_msg,
const std::initializer_list< int > &  mappings 
)
inlineprivate

Helper to retrieve axis value based on controller mode.

◆ get_button()

int ControllerTeleop::get_button ( const sensor_msgs::msg::Joy::SharedPtr &  joy_msg,
const std::initializer_list< int > &  mappings 
)
inlineprivate

Helper to retrieve button value based on controller mode.

◆ joy_callback()

void ControllerTeleop::joy_callback ( const sensor_msgs::msg::Joy::SharedPtr  joy_msg)
inlineprivate

Joystick input processing.

◆ velocity_callback()

void ControllerTeleop::velocity_callback ( const geometry_msgs::msg::Twist::SharedPtr  velocity_msg)
inlineprivate

Velocity message callback for navigation control.

Member Data Documentation

◆ a_button_

bool ControllerTeleop::a_button_
private

◆ b_button_

bool ControllerTeleop::b_button_
private

◆ d_pad_horizontal_

double ControllerTeleop::d_pad_horizontal_
private

◆ d_pad_vertical_

double ControllerTeleop::d_pad_vertical_
private

◆ home_button_

bool ControllerTeleop::home_button_
private

◆ joystick_subscriber_

rclcpp::Subscription<sensor_msgs::msg::Joy>::SharedPtr ControllerTeleop::joystick_subscriber_
private

◆ left_bumper_

double ControllerTeleop::left_bumper_
private

◆ left_joystick_x_

double ControllerTeleop::left_joystick_x_
private

◆ left_joystick_y_

double ControllerTeleop::left_joystick_y_
private

◆ left_speed_

double ControllerTeleop::left_speed_
private

◆ left_trigger_

double ControllerTeleop::left_trigger_
private

◆ left_wheel_motor_

SparkMax ControllerTeleop::left_wheel_motor_
private

◆ lift_actuator_motor_

SparkMax ControllerTeleop::lift_actuator_motor_
private

◆ lift_actuator_speed_

double ControllerTeleop::lift_actuator_speed_
private

◆ manual_enabled_

bool ControllerTeleop::manual_enabled_
private

◆ menu_button_

bool ControllerTeleop::menu_button_
private

◆ outdoor_mode_

bool ControllerTeleop::outdoor_mode_
private

◆ ps4_mode_

bool ControllerTeleop::ps4_mode_
private

◆ right_bumper_

double ControllerTeleop::right_bumper_
private

◆ right_joystick_y_

double ControllerTeleop::right_joystick_y_
private

◆ right_speed_

double ControllerTeleop::right_speed_
private

◆ right_trigger_

double ControllerTeleop::right_trigger_
private

◆ right_wheel_motor_

SparkMax ControllerTeleop::right_wheel_motor_
private

◆ robot_disabled_

bool ControllerTeleop::robot_disabled_
private

◆ share_button_

bool ControllerTeleop::share_button_
private

◆ speed_multiplier_

double ControllerTeleop::speed_multiplier_
private

◆ switch_mode_

bool ControllerTeleop::switch_mode_
private

◆ tilt_actuator_left_motor_

SparkMax ControllerTeleop::tilt_actuator_left_motor_
private

◆ tilt_actuator_right_motor_

SparkMax ControllerTeleop::tilt_actuator_right_motor_
private

◆ tilt_actuator_speed_

double ControllerTeleop::tilt_actuator_speed_
private

◆ velocity_subscriber_

rclcpp::Subscription<geometry_msgs::msg::Twist>::SharedPtr ControllerTeleop::velocity_subscriber_
private

◆ x_button_

bool ControllerTeleop::x_button_
private

◆ xbox_mode_

bool ControllerTeleop::xbox_mode_
private

◆ y_button_

bool ControllerTeleop::y_button_
private

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