├── .assets
└── COFFEE BUTTON ヾ(°∇°^).png
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── package.xml
└── src
└── teleop_twist_keyboard.cpp
/.assets/COFFEE BUTTON ヾ(°∇°^).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/methylDragon/teleop_twist_keyboard_cpp/525fb108bbe7ad2527b82cc9ebc0d461b1bdadf3/.assets/COFFEE BUTTON ヾ(°∇°^).png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .swp
2 | .save
3 | .bak
4 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(teleop_twist_keyboard_cpp)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | roscpp
6 | geometry_msgs
7 | )
8 |
9 | catkin_package(
10 | INCLUDE_DIRS src
11 | CATKIN_DEPENDS roscpp geometry_msgs
12 | )
13 |
14 | include_directories(${catkin_INCLUDE_DIRS})
15 |
16 | add_executable(teleop_twist_keyboard src/teleop_twist_keyboard.cpp)
17 | target_link_libraries(teleop_twist_keyboard ${catkin_LIBRARIES})
18 |
19 | set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 methylDragon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # teleop_twist_keyboard_cpp
2 | C++ Implementation of the Generic Keyboard Teleop for ROS: https://github.com/ros-teleop/teleop_twist_keyboard
3 |
4 | ## Features
5 |
6 | This particular implementation does away with keeping the history of previous speed settings, and heavily cuts down on the amount of printing that is done to the terminal via the use of carriage returns (\r).
7 |
8 | Furthermore, the last command that was sent is reflected, and invalid commands are identified as such.
9 |
10 |
11 |
12 | ## Installing the Package
13 |
14 | As per standard ROS practice, make a workspace, go to the workspace's src directory, and clone this repository, then run catkin_make in the root of the workspace, and source the resulting setup.bash!
15 |
16 | ```bash
17 | $ git clone https://github.com/methylDragon/teleop_twist_keyboard_cpp.git
18 | $ cd ..
19 | $ catkin_make
20 |
21 | $ source devel/setup.bash
22 | ```
23 |
24 |
25 |
26 | ## Running the Node
27 |
28 | ```bash
29 | # In one terminal, run
30 | $ roscore
31 |
32 | # In another terminal, run
33 | $ rosrun teleop_twist_keyboard_cpp teleop_twist_keyboard
34 |
35 | # If you want to see the outputs, check the /cmd_vel topic
36 | $ rostopic echo /cmd_vel
37 | ```
38 |
39 |
40 |
41 | ## Usage
42 |
43 | Same as the original
44 |
45 | ```
46 | Reading from the keyboard and Publishing to Twist!
47 | ---------------------------
48 | Moving around:
49 | u i o
50 | j k l
51 | m , .
52 |
53 | For Holonomic mode (strafing), hold down the shift key:
54 | ---------------------------
55 | U I O
56 | J K L
57 | M < >
58 |
59 | t : up (+z)
60 | b : down (-z)
61 |
62 | anything else : stop
63 |
64 | q/z : increase/decrease max speeds by 10%
65 | w/x : increase/decrease only linear speed by 10%
66 | e/c : increase/decrease only angular speed by 10%
67 |
68 | CTRL-C to quit
69 | ```
70 |
71 |
72 |
73 | ------
74 |
75 | [.png)](https://www.buymeacoffee.com/methylDragon)
--------------------------------------------------------------------------------
/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | teleop_twist_keyboard_cpp
4 | 0.0.0
5 | Generic keyboard teleop for twist robots (in C++)! Based off of the teleop_twist_keyboard Python ROS node.
6 |
7 | methylDragon
8 | methylDragon
9 | http://github.com/methylDragon
10 | http://www.ros.org/wiki/teleop_twist_keyboard_cpp
11 |
12 | MIT
13 |
14 | catkin
15 |
16 | roscpp
17 | geometry_msgs
18 |
19 | roscpp
20 | geometry_msgs
21 |
22 | roscpp
23 | geometry_msgs
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/teleop_twist_keyboard.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include