Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CmdServer Class Reference

#include <cmd_server.hpp>

Public Member Functions

 CmdServer (ros::NodeHandle &nh)
 
void robotReady ()
 Robot motion executed when cmdServer is ready. More...
 
void setupServer ()
 
void stopServer ()
 
void waitForCmd ()
 
 ~CmdServer ()
 

Protected Member Functions

void init ()
 
void loadParams ()
 
void rosSetup ()
 

Protected Attributes

ros::NodeHandle nh_
 

Private Member Functions

void accelCB (const marty_msgs::Accelerometer &msg)
 
void arms (int r_angle=0, int l_angle=0)
 
void ballCB (const geometry_msgs::Pose2D &msg)
 
void battCB (const std_msgs::Float32 &msg)
 
void celebrate (int move_time=4000)
 
bool cmd_service (marty_msgs::Command::Request &req, marty_msgs::Command::Response &res)
 
void currCB (const marty_msgs::MotorCurrents &msg)
 
void dance (int robot_id)
 
void demo ()
 
void eyes (int amount=0, int amount2=0)
 
void getData (int sensor, int id)
 
void gpioCB (const marty_msgs::GPIOs &msg)
 
void hello ()
 
void kick (int side=CMD_LEFT, int move_time=3000)
 
void lean (int dir, int amount=100, int move_time=2000)
 
void liftLeg (int leg, int amount=100, int move_time=2000)
 
void lowerLeg (int move_time=1000)
 
void moveJoint (int side, int joint, int amount, int move_time=2000)
 
void playSound (int freq=440, int duration=500)
 
void playSounds (std::vector< int > sounds)
 
void runCommand (vector< int > data)
 Runs commands received by the server. More...
 
void runSockCommand (vector< int8_t > data)
 
void sideStep (int side, int num_steps=1, int move_time=1000, int step_length=50)
 
void sitBack (int duration)
 
void standStraight (int move_time=1000)
 
void stopRobot ()
 
void swingArms (int r_arm, int l_arm, int duration=2000, int cycles=4)
 
void swingJoints (marty_msgs::ServoMsgArray, int duration=2000, int cycles=4)
 
void testLeg (int side, int duration)
 
void walk (int num_steps=2, int turn=0, int move_time=3000, int step_length=50, int side=-1)
 

Private Attributes

marty_msgs::Accelerometer accel_data_
 
ros::Subscriber accel_sub_
 
geometry_msgs::Pose2D ball_pos_
 
ros::Subscriber ball_sub_
 
std_msgs::Float32 batt_data_
 
ros::Subscriber batt_sub_
 
bool busy_
 
std::vector< int > cmd_data_
 
std::vector< std::vector< int > > cmd_queue_
 
ros::ServiceServer cmd_srv_
 
marty_msgs::MotorCurrents curr_data_
 
ros::Subscriber curr_sub_
 
marty_msgs::GPIOs gpio_data_
 
ros::Subscriber gpio_sub_
 
float interp_dt_
 
bool ready_move_
 
bool resp_request_
 
MartyCorerobot_
 
bool ros_cmd_
 
int sock_
 
bool turn_spot_
 
float val_request_
 

Detailed Description

Definition at line 91 of file cmd_server.hpp.

Constructor & Destructor Documentation

CmdServer::CmdServer ( ros::NodeHandle &  nh)

Definition at line 530 of file cmd_server.cpp.

CmdServer::~CmdServer ( )

Definition at line 537 of file cmd_server.cpp.

Member Function Documentation

void CmdServer::accelCB ( const marty_msgs::Accelerometer &  msg)
inlineprivate

Definition at line 131 of file cmd_server.hpp.

void CmdServer::arms ( int  r_angle = 0,
int  l_angle = 0 
)
private

Definition at line 307 of file cmd_server.cpp.

void CmdServer::ballCB ( const geometry_msgs::Pose2D &  msg)
inlineprivate

Definition at line 134 of file cmd_server.hpp.

void CmdServer::battCB ( const std_msgs::Float32 &  msg)
inlineprivate

Definition at line 132 of file cmd_server.hpp.

void CmdServer::celebrate ( int  move_time = 4000)
private

Definition at line 250 of file cmd_server.cpp.

bool CmdServer::cmd_service ( marty_msgs::Command::Request &  req,
marty_msgs::Command::Response &  res 
)
private

Definition at line 569 of file cmd_server.cpp.

void CmdServer::currCB ( const marty_msgs::MotorCurrents &  msg)
inlineprivate

Definition at line 133 of file cmd_server.hpp.

void CmdServer::dance ( int  robot_id)
private

Definition at line 302 of file cmd_server.cpp.

void CmdServer::demo ( )
private

Definition at line 312 of file cmd_server.cpp.

void CmdServer::eyes ( int  amount = 0,
int  amount2 = 0 
)
private

Definition at line 167 of file cmd_server.cpp.

void CmdServer::getData ( int  sensor,
int  id 
)
private

Definition at line 171 of file cmd_server.cpp.

void CmdServer::gpioCB ( const marty_msgs::GPIOs &  msg)
inlineprivate

Definition at line 130 of file cmd_server.hpp.

void CmdServer::hello ( )
private

Definition at line 113 of file cmd_server.cpp.

void CmdServer::init ( )
protected

Definition at line 551 of file cmd_server.cpp.

void CmdServer::kick ( int  side = CMD_LEFT,
int  move_time = 3000 
)
private

Definition at line 154 of file cmd_server.cpp.

void CmdServer::lean ( int  dir,
int  amount = 100,
int  move_time = 2000 
)
private

Definition at line 238 of file cmd_server.cpp.

void CmdServer::liftLeg ( int  leg,
int  amount = 100,
int  move_time = 2000 
)
private

Definition at line 261 of file cmd_server.cpp.

void CmdServer::loadParams ( )
protected

Definition at line 541 of file cmd_server.cpp.

void CmdServer::lowerLeg ( int  move_time = 1000)
private

Definition at line 279 of file cmd_server.cpp.

void CmdServer::moveJoint ( int  side,
int  joint,
int  amount,
int  move_time = 2000 
)
private

Definition at line 194 of file cmd_server.cpp.

void CmdServer::playSound ( int  freq = 440,
int  duration = 500 
)
private
void CmdServer::playSounds ( std::vector< int >  sounds)
private

Definition at line 499 of file cmd_server.cpp.

void CmdServer::robotReady ( )

Robot motion executed when cmdServer is ready.

Definition at line 16 of file cmd_server.cpp.

void CmdServer::rosSetup ( )
protected

Definition at line 560 of file cmd_server.cpp.

void CmdServer::runCommand ( vector< int >  data)
private

Runs commands received by the server.

Here is where you may add new functions for Marty to do. Don't forget to create a CmdServer::function() as well as its definition in the cmd_server.hpp

Parameters
dataReceived data array

Definition at line 48 of file cmd_server.cpp.

void CmdServer::runSockCommand ( vector< int8_t >  data)
private

Definition at line 98 of file cmd_server.cpp.

void CmdServer::setupServer ( )

Definition at line 576 of file cmd_server.cpp.

void CmdServer::sideStep ( int  side,
int  num_steps = 1,
int  move_time = 1000,
int  step_length = 50 
)
private

Definition at line 472 of file cmd_server.cpp.

void CmdServer::sitBack ( int  duration)
private

Definition at line 422 of file cmd_server.cpp.

void CmdServer::standStraight ( int  move_time = 1000)
private

Definition at line 486 of file cmd_server.cpp.

void CmdServer::stopRobot ( )
private

Definition at line 516 of file cmd_server.cpp.

void CmdServer::stopServer ( )

Definition at line 598 of file cmd_server.cpp.

void CmdServer::swingArms ( int  r_arm,
int  l_arm,
int  duration = 2000,
int  cycles = 4 
)
private

Definition at line 427 of file cmd_server.cpp.

void CmdServer::swingJoints ( marty_msgs::ServoMsgArray  servo_array,
int  duration = 2000,
int  cycles = 4 
)
private

Definition at line 448 of file cmd_server.cpp.

void CmdServer::testLeg ( int  side,
int  duration 
)
private

Definition at line 411 of file cmd_server.cpp.

void CmdServer::waitForCmd ( )

Definition at line 602 of file cmd_server.cpp.

void CmdServer::walk ( int  num_steps = 2,
int  turn = 0,
int  move_time = 3000,
int  step_length = 50,
int  side = -1 
)
private

Definition at line 126 of file cmd_server.cpp.

Member Data Documentation

marty_msgs::Accelerometer CmdServer::accel_data_
private

Definition at line 155 of file cmd_server.hpp.

ros::Subscriber CmdServer::accel_sub_
private

Definition at line 162 of file cmd_server.hpp.

geometry_msgs::Pose2D CmdServer::ball_pos_
private

Definition at line 158 of file cmd_server.hpp.

ros::Subscriber CmdServer::ball_sub_
private

Definition at line 165 of file cmd_server.hpp.

std_msgs::Float32 CmdServer::batt_data_
private

Definition at line 156 of file cmd_server.hpp.

ros::Subscriber CmdServer::batt_sub_
private

Definition at line 163 of file cmd_server.hpp.

bool CmdServer::busy_
private

Definition at line 139 of file cmd_server.hpp.

std::vector<int> CmdServer::cmd_data_
private

Definition at line 151 of file cmd_server.hpp.

std::vector<std::vector<int> > CmdServer::cmd_queue_
private

Definition at line 152 of file cmd_server.hpp.

ros::ServiceServer CmdServer::cmd_srv_
private

Definition at line 166 of file cmd_server.hpp.

marty_msgs::MotorCurrents CmdServer::curr_data_
private

Definition at line 157 of file cmd_server.hpp.

ros::Subscriber CmdServer::curr_sub_
private

Definition at line 164 of file cmd_server.hpp.

marty_msgs::GPIOs CmdServer::gpio_data_
private

Definition at line 154 of file cmd_server.hpp.

ros::Subscriber CmdServer::gpio_sub_
private

Definition at line 161 of file cmd_server.hpp.

float CmdServer::interp_dt_
private

Definition at line 150 of file cmd_server.hpp.

ros::NodeHandle CmdServer::nh_
protected

Definition at line 93 of file cmd_server.hpp.

bool CmdServer::ready_move_
private

Definition at line 145 of file cmd_server.hpp.

bool CmdServer::resp_request_
private

Definition at line 141 of file cmd_server.hpp.

MartyCore* CmdServer::robot_
private

Definition at line 148 of file cmd_server.hpp.

bool CmdServer::ros_cmd_
private

Definition at line 140 of file cmd_server.hpp.

int CmdServer::sock_
private

Definition at line 149 of file cmd_server.hpp.

bool CmdServer::turn_spot_
private

Definition at line 142 of file cmd_server.hpp.

float CmdServer::val_request_
private

Definition at line 153 of file cmd_server.hpp.


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


ros_marty
Author(s): Alejandro Bordallo
autogenerated on Fri Jul 21 2017 14:51:45