Giter Site home page Giter Site logo

zerenluo123 / keyboard_ctrl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wanghuohuo0716/key_board

0.0 0.0 0.0 51 KB

本仓库是ros的一个package(C++),通过读取键盘按键"w","a","s","d"按键指令发送指定的topic,此package可以用来简单控制机器人移动

C++ 84.49% CMake 15.51%

keyboard_ctrl's Introduction

本仓库是ros的一个package(C++),通过读取键盘按键"w","a","s","d"按键指令发送指定的topic,此package可以用来简单控制机器人移动

topic名称为cmd_vel,数据类型为geometry_msgs::Twist,控制的是机器人的速度

1.编译安装

将此仓库clone到catkin_ws/src后,回到catkin_ws工作路径下,执行编译命令即可

注意:如何提示找不到boost库,需要安装boost库。sudo apt-get install boost

2.运行

运行:rosrun keyboard keyboard_node

3.使用

鼠标选中运行节点的终端,"w","a","s","d"键控制前后左右运动(shift+"w"会加速)

如果希望机器人一直运动,按下按键不动即可循环发送命令,松开则机器人停止

4.代码机制

当按键按下时才会发布topic,按键未按下时不会发布topic

按下按键后会发送两次topic,第一次是设定的速度,第二次是将速度置为0后再次发出,避免机器人一直是设定的速度

keyboard_ctrl's People

Contributors

wanghuohuo0716 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.