7 privateNh.
param<std::string>(
"autonomy_cmd_vel_topic",
9 privateNh.
param<std::string>(
"teleoperation_cmd_vel_topic",
13 privateNh.
param(
"teleoperation_idle_timer",
51 geometry_msgs::Twist cmd_vel;
63 rsm_msgs::OperationMode msg;
70 rsm_msgs::SetOperationMode::Response &res) {
74 res.message =
"Operation mode set";
79 const geometry_msgs::Twist::ConstPtr& cmd_vel) {
84 const geometry_msgs::Twist::ConstPtr& cmd_vel) {
117 geometry_msgs::Twist empty_cmd_vel;
123 const sensor_msgs::Joy::ConstPtr& joy) {
124 bool movingCommand =
false;
126 for (
unsigned int i = 0; i < joy->axes.size(); i++) {
127 if ((std::abs(joy->axes[i]) - std::abs(
_joystick_cmd.axes[i]))
129 movingCommand =
true;
134 for (
unsigned int i = 0; i < joy->buttons.size(); i++) {
136 movingCommand =
true;
141 return movingCommand;
ros::Publisher _cmd_vel_pub
void teleoperationIdleTimerCallback(const ros::TimerEvent &event)
std::string _joystick_topic
ros::ServiceServer _set_operation_mode_service
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())
bool checkJoystickCommand(const sensor_msgs::Joy::ConstPtr &joy)
ros::Publisher _operation_mode_pub
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
geometry_msgs::Twist _teleoperation_cmd_vel
double _teleoperation_idle_timer_duration
std::string _teleoperation_cmd_vel_topic
ros::Subscriber _teleoperation_cmd_vel_sub
bool setOperationMode(rsm_msgs::SetOperationMode::Request &req, rsm_msgs::SetOperationMode::Response &res)
ros::Timer _teleoperation_idle_timer
sensor_msgs::Joy _joystick_cmd
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void joystickCallback(const sensor_msgs::Joy::ConstPtr &joy)
void teleoperationCmdVelCallback(const geometry_msgs::Twist::ConstPtr &cmd_vel)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
void autonomyCmdVelCallback(const geometry_msgs::Twist::ConstPtr &cmd_vel)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Subscriber _autonomy_cmd_vel_sub
std::string _cmd_vel_topic
std::string _autonomy_operation_cmd_vel_topic
ros::Subscriber _joystick_sub
bool _emergency_stop_active
void publishOperationMode()
geometry_msgs::Twist _autonomy_cmd_vel