69 for(uint i=0;i<
button.size(); i++)
74 for(uint i=0;i<
analog.size(); i++)
109 if(!
analog[i].toggled && ( fabs(joy->axes[i]) > 0.005 ))
112 if( fabs(
analog[i].val -joy->axes[i]) > 0.005 &&
analog[i].toggled)
114 analog[i].val = joy->axes[i];
float speed_min
car speed limits
ros::Publisher atlascar_cmd_
method just to publish the base message
atlascar_base::AtlascarCommand command
struct with the Atlascar Base Command message
void XboxCallback(const sensor_msgs::Joy::ConstPtr &joy)
callback that is called when a xbox msg is received
int num_buttons
variable with number of digital buttons and analog axis
ros::Subscriber joy_sub_
method to subscribe the gamepad message
float steering_left_ang
limit values for the steering angles
ros::NodeHandle nh_teleop
XboxTeleopAtlascar(int num_but, int num_axis)
constructor
float m_speed
line segment slope to calculate whished car speed value
class_xbpox_teleop.h file for this node. Includes, class global vars, class methods, etc.
float m_brake
line segment slope to calculate whished car speed value
vector< int > button
vector with all digital buttons status
float m_left_ang
line segment slope, left side and right side
vector< TYPE_analog > analog
vector with analog/axis values