6 #include <sensor_msgs/Joy.h> 7 #include <geometry_msgs/Twist.h> 24 geometry_msgs::Twist twist;
33 if(!_nodeHandle.
getParam(
"drive_joy_teleop_linear_axis", _linearAxisIndex)
34 || !_nodeHandle.
getParam(
"drive_joy_teleop_angular_axis", _angularAxisIndex)
35 || !_nodeHandle.
getParam(
"drive_joy_teleop_deadman_button", _deadManIndex)
36 || !_nodeHandle.
getParam(
"drive_joy_teleop_linear_max_vel", _linearScale)
37 || !_nodeHandle.
getParam(
"drive_joy_teleop_angular_max_vel", _angularScale)) {
38 ROS_ERROR(
"[%s]: Missing parameter, the requird parameters are: " 39 "drive_joy_teleop_linear_axis, drive_joy_teleop_angular_axis" 40 ", drive_joy_teleop_deadman_button , drive_joy_teleop_linear_max_vel" 46 _cmd = _nodeHandle.
advertise<geometry_msgs::Twist>(
"joy_vel", 10);
58 int main(
int argc,
char **argv) {
void joyCallback(const sensor_msgs::Joy::ConstPtr &msg)
void publish(const boost::shared_ptr< M > &message) const
ros::NodeHandle _nodeHandle
ros::Subscriber _joyListener
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)
ROSCPP_DECL const std::string & getName()
ROSCPP_DECL void spin(Spinner &spinner)
int main(int argc, char **argv)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool getParam(const std::string &key, std::string &s) const
ROSCPP_DECL void shutdown()