2 #include <geometry_msgs/Twist.h> 3 #include <std_msgs/String.h> 4 #include <sensor_msgs/Joy.h> 15 geometry_msgs::Twist vel;
16 vel.linear.x =
max_vel_x * (joy->axes[2] + 1) / 2 * joy->axes[1];
20 if (joy->buttons[0] != 0) {
27 int main(
int argc,
char** argv)
29 ros::init(argc, argv,
"uos_diffdrive_teleop_cyborgevo");
40 vel_pub = nh.
advertise<geometry_msgs::Twist>(
"cmd_vel", 1);
41 req_pub = nh.
advertise<std_msgs::String>(
"request", 1);
double max_rotational_vel
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void cyborgevoCallback(const sensor_msgs::Joy::ConstPtr &joy)