2 #include <sensor_msgs/Joy.h> 3 #include <geometry_msgs/TwistStamped.h> 8 #define COMMAND_TIMEOUT_SEC 0.5 45 if(mNumberOfRobots > 1)
46 sprintf(topic,
"/robot_%d/cmd_vel", i);
48 sprintf(topic,
"/cmd_vel");
51 geometry_msgs::Twist twist;
80 int main(
int argc,
char** argv)
89 num = (
unsigned int)atoi(argv[1]);
93 ROS_INFO(
"Using Joystick to operate %d robots in simulation!", num);
std::vector< ros::Publisher > mCommandPublisher
ros::Subscriber mJoySubscriber
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void receiveJoyMessage(const sensor_msgs::Joy::ConstPtr &msg)
std::vector< geometry_msgs::Twist > mCommand
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
SimOperator(unsigned int numOfRobots)
int main(int argc, char **argv)
double mMaxLinearVelocity
ROSCPP_DECL void spinOnce()
double mMaxAngularVelocity
unsigned int mNumberOfRobots