Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
PongGame Class Reference

Classes

struct  PlayerContext
 

Public Member Functions

 PongGame ()
 

Private Member Functions

void makeBallMarker ()
 
void makeFieldMarker ()
 
void makePaddleMarkers ()
 
void normalizeVel ()
 
void processPaddleFeedback (unsigned player, const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 
bool reflect (float &pos, float last_pos, float limit, float &t)
 
void reset ()
 
void setPaddlePos (unsigned player, float pos)
 
void spinOnce ()
 
void updateBall ()
 
void updateScore ()
 

Private Attributes

float ball_dir_x_
 
float ball_dir_y_
 
float ball_pos_x_
 
float ball_pos_y_
 
InteractiveMarker field_marker_
 
ros::Timer game_loop_timer_
 
float last_ball_pos_x_
 
float last_ball_pos_y_
 
std::vector< PlayerContextplayer_contexts_
 
interactive_markers::InteractiveMarkerServer server_
 
float speed_
 

Detailed Description

Definition at line 50 of file pong.cpp.

Constructor & Destructor Documentation

◆ PongGame()

PongGame::PongGame ( )
inline

Definition at line 54 of file pong.cpp.

Member Function Documentation

◆ makeBallMarker()

void PongGame::makeBallMarker ( )
inlineprivate

Definition at line 436 of file pong.cpp.

◆ makeFieldMarker()

void PongGame::makeFieldMarker ( )
inlineprivate

Definition at line 312 of file pong.cpp.

◆ makePaddleMarkers()

void PongGame::makePaddleMarkers ( )
inlineprivate

Definition at line 357 of file pong.cpp.

◆ normalizeVel()

void PongGame::normalizeVel ( )
inlineprivate

Definition at line 239 of file pong.cpp.

◆ processPaddleFeedback()

void PongGame::processPaddleFeedback ( unsigned  player,
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback 
)
inlineprivate

Definition at line 205 of file pong.cpp.

◆ reflect()

bool PongGame::reflect ( float &  pos,
float  last_pos,
float  limit,
float &  t 
)
inlineprivate

Definition at line 250 of file pong.cpp.

◆ reset()

void PongGame::reset ( )
inlineprivate

Definition at line 228 of file pong.cpp.

◆ setPaddlePos()

void PongGame::setPaddlePos ( unsigned  player,
float  pos 
)
inlineprivate

Definition at line 177 of file pong.cpp.

◆ spinOnce()

void PongGame::spinOnce ( )
inlineprivate

Definition at line 75 of file pong.cpp.

◆ updateBall()

void PongGame::updateBall ( )
inlineprivate

Definition at line 266 of file pong.cpp.

◆ updateScore()

void PongGame::updateScore ( )
inlineprivate

Definition at line 275 of file pong.cpp.

Member Data Documentation

◆ ball_dir_x_

float PongGame::ball_dir_x_
private

Definition at line 490 of file pong.cpp.

◆ ball_dir_y_

float PongGame::ball_dir_y_
private

Definition at line 491 of file pong.cpp.

◆ ball_pos_x_

float PongGame::ball_pos_x_
private

Definition at line 487 of file pong.cpp.

◆ ball_pos_y_

float PongGame::ball_pos_y_
private

Definition at line 488 of file pong.cpp.

◆ field_marker_

InteractiveMarker PongGame::field_marker_
private

Definition at line 472 of file pong.cpp.

◆ game_loop_timer_

ros::Timer PongGame::game_loop_timer_
private

Definition at line 470 of file pong.cpp.

◆ last_ball_pos_x_

float PongGame::last_ball_pos_x_
private

Definition at line 484 of file pong.cpp.

◆ last_ball_pos_y_

float PongGame::last_ball_pos_y_
private

Definition at line 485 of file pong.cpp.

◆ player_contexts_

std::vector<PlayerContext> PongGame::player_contexts_
private

Definition at line 482 of file pong.cpp.

◆ server_

Definition at line 468 of file pong.cpp.

◆ speed_

float PongGame::speed_
private

Definition at line 492 of file pong.cpp.


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


interactive_marker_tutorials
Author(s): David Gossow
autogenerated on Wed Mar 2 2022 01:13:07