2 #include <geometry_msgs/Twist.h> 10 #define KEYCODE_D 0x42 11 #define KEYCODE_Q 0x71 41 struct termios cooked,
raw;
46 tcsetattr(
kfd, TCSANOW, &cooked);
52 int main(
int argc,
char** argv)
72 tcgetattr(
kfd, &cooked);
73 memcpy(&
raw, &cooked,
sizeof(
struct termios));
74 raw.c_lflag &=~ (ICANON | ECHO);
78 tcsetattr(
kfd, TCSANOW, &
raw);
80 puts(
"Reading from keyboard");
81 puts(
"---------------------------");
82 puts(
"Use arrow keys to move the turtle.");
88 if(read(
kfd, &c, 1) < 0)
122 geometry_msgs::Twist twist;
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Publisher twist_pub_
int main(int argc, char **argv)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
struct termios cooked raw
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void shutdown()