Defines | Enumerations | Functions | Variables
draw_square.cpp File Reference
#include <boost/bind.hpp>
#include <ros/ros.h>
#include <turtlesim/Pose.h>
#include <geometry_msgs/Twist.h>
#include <std_srvs/Empty.h>
Include dependency graph for draw_square.cpp:

Go to the source code of this file.

Defines

#define PI   3.141592

Enumerations

enum  State { FORWARD, STOP_FORWARD, TURN, STOP_TURN }

Functions

void commandTurtle (ros::Publisher twist_pub, float linear, float angular)
void forward (ros::Publisher twist_pub)
bool hasReachedGoal ()
bool hasStopped ()
int main (int argc, char **argv)
void poseCallback (const turtlesim::PoseConstPtr &pose)
void printGoal ()
void stopForward (ros::Publisher twist_pub)
void stopTurn (ros::Publisher twist_pub)
void timerCallback (const ros::TimerEvent &, ros::Publisher twist_pub)
void turn (ros::Publisher twist_pub)

Variables

bool g_first_goal_set = false
turtlesim::Pose g_goal
State g_last_state = FORWARD
turtlesim::PoseConstPtr g_pose
State g_state = FORWARD

Define Documentation

#define PI   3.141592

Definition at line 22 of file draw_square.cpp.


Enumeration Type Documentation

enum State
Enumerator:
FORWARD 
STOP_FORWARD 
TURN 
STOP_TURN 

Definition at line 10 of file draw_square.cpp.


Function Documentation

void commandTurtle ( ros::Publisher  twist_pub,
float  linear,
float  angular 
)

Definition at line 44 of file draw_square.cpp.

void forward ( ros::Publisher  twist_pub)

Definition at line 87 of file draw_square.cpp.

bool hasReachedGoal ( )

Definition at line 29 of file draw_square.cpp.

bool hasStopped ( )

Definition at line 34 of file draw_square.cpp.

int main ( int  argc,
char **  argv 
)

Definition at line 148 of file draw_square.cpp.

void poseCallback ( const turtlesim::PoseConstPtr &  pose)

Definition at line 24 of file draw_square.cpp.

void printGoal ( )

Definition at line 39 of file draw_square.cpp.

void stopForward ( ros::Publisher  twist_pub)

Definition at line 52 of file draw_square.cpp.

void stopTurn ( ros::Publisher  twist_pub)

Definition at line 69 of file draw_square.cpp.

void timerCallback ( const ros::TimerEvent ,
ros::Publisher  twist_pub 
)

Definition at line 113 of file draw_square.cpp.

void turn ( ros::Publisher  twist_pub)

Definition at line 100 of file draw_square.cpp.


Variable Documentation

bool g_first_goal_set = false

Definition at line 20 of file draw_square.cpp.

turtlesim::Pose g_goal

Definition at line 8 of file draw_square.cpp.

Definition at line 19 of file draw_square.cpp.

turtlesim::PoseConstPtr g_pose

Definition at line 7 of file draw_square.cpp.

Definition at line 18 of file draw_square.cpp.



turtlesim
Author(s): Josh Faust
autogenerated on Thu Jun 6 2019 20:20:12