20 #include <geometry_msgs/Twist.h> 21 #include <geometry_msgs/TwistStamped.h> 22 #include <sensor_msgs/Joy.h> 24 #include <boost/thread/mutex.hpp> 41 ROS_WARN(
"No 'root_frame' specified. Setting to 'base_link'!");
50 ROS_ERROR(
"No 'chain_tip_link' specified. Using 'root_frame' instead!");
71 boost::mutex::scoped_lock lock(
mutex_);
82 geometry_msgs::TwistStamped ts;
103 boost::mutex::scoped_lock lock(
mutex_);
115 boost::mutex::scoped_lock lock(
mutex_);
137 geometry_msgs::TwistStamped
ts_;
141 int main(
int argc,
char **argv)
143 ros::init(argc, argv,
"spacenav_commander");
void twistSpacenavCallback(const geometry_msgs::Twist::ConstPtr &msg)
Receive Twist from a 6d input device (e.g. 3DConnexion SpaceNavigator)
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())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void joySpacenavCallback(const sensor_msgs::Joy::ConstPtr &msg)
Receive Joy from a 6d input device (e.g. 3DConnexion SpaceNavigator)
void timerCallback(const ros::TimerEvent &)
ROSCPP_DECL void spin(Spinner &spinner)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
ros::Subscriber joy_spacenav_sub_
int main(int argc, char **argv)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher twist_pub_
bool getParam(const std::string &key, std::string &s) const
geometry_msgs::TwistStamped ts_
bool hasParam(const std::string &key) const
ros::Subscriber twist_spacenav_sub_