GithubHelp home page GithubHelp logo

teleop_twist_keyboard's Introduction

teleop_twist_keyboard

Generic Keyboard Teleop for ROS

Launch

Run.

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

With custom values.

rosrun teleop_twist_keyboard teleop_twist_keyboard.py _speed:=0.9 _turn:=0.8

Publishing to a different topic (in this case my_cmd_vel).

rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=my_cmd_vel

Usage

Reading from the keyboard  and Publishing to Twist!
---------------------------
Moving around:
   u    i    o
   j    k    l
   m    ,    .

For Holonomic mode (strafing), hold down the shift key:
---------------------------
   U    I    O
   J    K    L
   M    <    >

t : up (+z)
b : down (-z)

anything else : stop

q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%

CTRL-C to quit

Repeat Rate

If your mobile base requires constant updates on the cmd_vel topic, teleop_twist_keyboard can be configured to repeat the last command at a fixed interval, using the repeat_rate private parameter.

For example, to repeat the last command at 10Hz:

rosrun teleop_twist_keyboard teleop_twist_keyboard.py _repeat_rate:=10.0

It is highly recommened that the repeat rate be used in conjunction with the key timeout, to prevent runaway robots.

Key Timeout

Teleop_twist_keyboard can be configured to stop your robot if it does not receive any key presses in a configured time period, using the key_timeout private parameter.

For example, to stop your robot if a keypress has not been received in 0.6 seconds:

rosrun teleop_twist_keyboard teleop_twist_keyboard.py _key_timeout:=0.6

It is recommended that you set key_timeout higher than the initial key repeat delay on your system (This delay is 0.5 seconds by default on Ubuntu, but can be adjusted).

Twist with header

Publishing a TwistStamped message instead of Twist can be enabled with the stamped private parameter. Additionally the frame_id of the TwistStamped message can be set with the frame_id private parameter.

rosrun teleop_twist_keyboard teleop_twist_keyboard.py _stamped:=True _frame_id:=base_link

teleop_twist_keyboard's People

Contributors

5730289021-nn avatar asukiaaa avatar k-okada avatar kk6axq avatar kodie-artner avatar liohau avatar lucasw avatar matthijsburgh avatar mikepurvis avatar trainman419 avatar trazcobalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teleop_twist_keyboard's Issues

Could not process inbound connection: topic types do not match: [geometry_msgs/TwistStamped] vs. [geometry_msgs/Twist]{'callerid':

WARN] [1698550428.587674]: Could not process inbound connection: topic types do not match: [geometry_msgs/TwistStamped] vs. [geometry_msgs/Twist]{'callerid':

Topic mismatch problem, the device need geometry_msgs/TwistStamped ,I use

rosrun teleop_twist_keyboard teleop_twist_keyboard.py _stamped:=True _frame_id:=base_link I not download code , I install it , When I download code it's ok

ModuleNotFoundError: No module named 'termios'

I am using ros on windows (not on wsl ) and want to use teleop twist keyboard package to control the robot, and it is showing error ModuleNotFoundError: No module named 'termios' i searched on google and found that termios in not for windows so what can do to solve this problem, also while searching online i found termiwin, should I use that, if yes how

TabError: inconsistent use of tabs and spaces in indentation

When I run "rosrun teleop_twist_keyboard teleop_twist_keyboard.py",I get this error:
File "/opt/ros/melodic/lib/teleop_twist_keyboard/teleop_twist_keyboard.py", line 83
pub = rospy.Publisher('cmd_vel', Twist, queue_size = 1)
^
TabError: inconsistent use of tabs and spaces in indentation

then I replace all the "Tab" to "space" ,it works!!
So, does this code need to be modified?

key_timeout too high and not properly adjustable

Hi,

I would like to be able to teleoperate a robot similar to a joystick: when I release the joystick, the robot would just stop. Instead, when I run this command

$rosrun teleop_twist_keyboard teleop_twist_keyboard.py _key_timeout:=0.5

the robot continues to move for another 0.5 seconds, somethimes hitting an obstacle or wall. After 0.5 seconds, the robot stops.

I tried to lower the 0.5 value, say to 0.4, but then I get into another issue. When I start the robot from standstill and press the "I" key on the keyboard (meaning requesting to go forward) and check

$rosrun echo /cmd_vel

it shows that the teleop_twist_keyboard node publishes alternatively the desired value (corresponding to pressing the "I" key on the keyboard) but alternating this with publishing zeros for some mysterious reason. As a consequence the robot starts "shaking" as a consequence of the inputs requesting advancing, then stopping, then advancing etc. In other words the behavior I get is that the robot is not moving forward by just accelerating (as desired).

How can I lower that key_timeout value from 0.5 to, say 0.05 or even arbitrarily close to zero?
(My feeling is that the answer has something to do with this info copy-pasted from the readme.md: "It is recommended that you set key_timeout higher than the initial key repeat delay on your system (This delay is 0.5 seconds by default on Ubuntu, but can be adjusted)."

Thank you.

Noetic release

Will this package be released for Noetic anytime soon :)?

Shift+"_" (movement to right-backwards) publishes zero velocity

installed through apt and ran with

sudo apt install ros-noetic-teleop-twist-keyboard
apt-show-versions ros-noetic-teleop-twist-keyboard
ros-noetic-teleop-twist-keyboard:amd64/focal 1.0.0-1focal.20220926.190755 uptodate
rosrun teleop_twist_keyboard teleop_twist_keyboard.py

im seeing speeds published to /cmd_vel for all directions except when i click shift+_ which i believe is supposed to send commands

linear: 
  x: -0.5
  y: -0.5
  z: 0.0

but sends all zeroes instead. Am I the only one seeing this?

Cannot use "moving around " keys

Hi,
I'm using this package with bebop_autonomy but the moving around keys doesn't work
The other keys work (t,b,q,z,ecc)
I think this might be a problem of the formatting of the commands that are sent when I press the moving keys because I'm also not able to move the drone using rostopic
I used different formats but none works:
rostopic pub /cmd_vel geometry_msgs/Twist "linear: x: 100 y: 100 z: 100 angular: z: 10"
rostopic pub /cmd_vel geometry_msgs/Twist ["100 100 100", "100"]
I tried every format but none works

Waiting for subscribers to connect to /cmd_vel

This error seems to occur when the ROS_IP isn't set. It would be an idea that the script would check at the start if it is set and if not would display an error message.

$ export ROS_MASTER_URI=http://10.0.0.1:11311/
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
The rosdep view is empty: call ‘sudo rosdep init’ and ‘rosdep update’
Waiting for subscribers to connect to /cmd_vel
Waiting for subscribers to connect to /cmd_vel
Waiting for subscribers to connect to /cmd_vel
Waiting for subscribers to connect to /cmd_vel

After setting ROS_IP:

$ export ROS_IP=10.0.0.13
$ export ROS_MASTER_URI=http://10.0.0.1:11311/
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
The rosdep view is empty: call ‘sudo rosdep init’ and ‘rosdep update’
Reading from the keyboard and Publishing to Twist!
.....

Problems with speed_limit and turn_limit

I tried to set the variables speed_limit and turn_limit with a .yaml file and when I run the launch file, the following appear as parameters:

  • /teleop_twist_keyboard/speed_limit: 0.5
  • /teleop_twist_keyboard/turn_limit: 1.0

But even so, when I increase the speed, it exceeds the limits indicated, how could I solve the problem?

.yaml file:

speed_limit: 0.50
turn_limit: 1.0

launch file:

<node pkg="teleop_twist_keyboard" name="teleop_twist_keyboard" type="teleop_twist_keyboard.py" output="screen">
  <remap from="/cmd_vel" to="/turtle1/cmd_vel"/>
  <rosparam command="load" file="$(arg config_filepath)"/>
</node>

Robot not stopping even after stop command is issued

Hi im using teleop to control my robot but i have a problem. The problem is the robot not stopping even after i pressed the key that isnt assosiated with any commands like the H key and to check i used rostopic echo i see that cmd_vel is receiving commands to stop. Do you have any suggestions as to whats causing this?

release for lunar

Dear maintainer,

It would be nice to have this package in ROS lunar.

Cheers,
Jiri

ros-teleop can not work in VM(NAT mode)

I am using teleop in VM to control the robotic car, but it doesn't work. The specific situation is as follows:
Teleop is installed on Ubuntu of the VM and VM is in NAT mode. The Teleop could work, but the robot could not pick up the instructions from it.
If the VM is switched to Bridge mode, Teleop can control and the instructions can be received by robot. This has been bothering me for a long time. I want to ask if you have any suggestions
I test the talker and listener example in NAT mode and it can work, it really make me confused.

Question about teleop_twist_keyboard.py

hello. It's not different, but I have a question because I have a question while using this code. Looking at the code, the speed value is 0.5 by default and the maximum value is 1000. Then I wonder if the default unit of the speed value here is m/s or some other unit.

Robot does not stop on key release

With other teleop_twist packages, typically releasing the chosen device also stops the movement.

Take for example the teleop_joy and the spacenav_node.

Can this be implemented to be consistent? I also think that it is the behaviour people expect when using this node.

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.