GithubHelp home page GithubHelp logo

teleop_tools's Introduction

teleop_tools

A set of generic teleoperation tools for any robot.

This contains the following teleoperation tools:

  • joy_teleop, a generic joystick interface for topics and actions
  • key_teleop, a lightweight console keyboard teleoperation utility
  • mouse_teleop, a pointing device (e.g. mouse, touchpad) teleoperation utility

teleop_tools's People

Contributors

andyze avatar arnatious avatar artivis avatar awesomebytes avatar bmagyar avatar borongyuan avatar clalancette avatar efernandez avatar gavanderhoorn avatar hidmic avatar jordi-pages avatar klintan avatar nfry321 avatar noel215 avatar petrox avatar po1 avatar rainct avatar russkel avatar sgstreet avatar someshdaga avatar timple avatar tzskp1 avatar youtalk 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

teleop_tools's Issues

Syntax error when launching key_teleop.py

rosrun key_teleop key_teleop.py gives me

File "~/catkin_ws/src/teleop_tools/key_teleop/scripts/key_teleop.py", line 63
    raise ValueError, 'lineno out of bounds'
                    ^
SyntaxError: invalid syntax

Unfortunately I know nothing of Python, so I can't help. I do know there's this big Python3 vs Python 2 thing. And python --version gives me Python 3.7.2 so is that it?

Empty message_value dict when loading from YAML file.

I'm trying to set-up a topic command that publishes a std_msgs/msg/Empty message. Here's the relevant snippet (under ros__parameters):

dock:
  type: topic
  interface_type: std_msgs/msg/Empty
  topic_name: dock 
  deadman_buttons: [3]  # X button
  message_value: {}

The issue I'm having is that the empty mapping under message_value gets transformed into None when ROS loads the values from the YAML configuration file. Would there be another way of letting joy_teleop know that no fields have to be set for the message it will publish?

For the time being, I've modified my local repository to ignore the message_value field if it is None. I could send that as a PR, but I also wonder is this isn't something that should be fixed "upstream" (rclpy?) so that users can, in general, use empty dictionaries.

keyboard teleop not reading keyboard correctly

OS: Ubuntu 22.04
ROS_DISTRO: ROS2 Humble
Arch: AMD64 / x86-64

When holding down the arrow keys, the input momentarily reads and publishes a 0.0 value. This occurs every time i hold down and arrow key and is reproducible on the version of keyboard teleop in this repo.
In this gif, I cycle through each arrow key and hold it down for several seconds. Notice that the output value momentarily goes to 0.0 and then recovers.

Peek 2023-08-29 16-47

Melodic release

I was wondering what are the release plans for melodic. I have cloned the repo and it compiles without problems. I have tested key_teleop and is working too.

[ROS2 Dashing] unnecessary warning at default use_sim_time parameter

@artivis - in both the source repo and ros-testing Debians on ROS Dashing, I receive this warning every time I launch the node:

[joy_teleop-2] [WARN] [joy_teleop]: parameter use_sim_time is not a dict

use_sim_time is a standard parameter supplied to every node at launch-time. If unset or set to False, the node should use system time, True to use sim_time.

Regardless of whether this node handles use_sim_time itself, it should handle the param more gracefully than throwing a warning in this codeblock:
https://github.com/ros-teleop/teleop_tools/blob/dashing-devel/joy_teleop/joy_teleop/joy_teleop.py#L75-L95

QoS conflict with joystick_drivers package

reliability=rclpy.qos.QoSReliabilityPolicy.RELIABLE,

I run joystick_drivers's joy node, that publishes on topic /joy with BEST_EFFORT QoS setting.
However, this node subscribes with RELIABLE QoS setting, thus the subscription won't work.

Since the packages that modifies (see above) the default QoS is this one, I open an issue on this repo.

If you want, I can test and push a PR where subscription reliability is parametrized. Let me know if there are alternative solutions.

EDIT: sorry, now for some reason I can see that both pub and sub are RELIABLE

Feature request: Handle missing axis and buttons gracefully

Hi Bence,

When using a joystick with less number of axis than configured in the yaml, joy_teleop drops some exceptions like

[ERROR] [WallTime: 1458832204.233291] bad callback: <bound method JoyTeleop.joy_callback of <__main__.JoyTeleop instance at 0x7fb0c71aa830>>
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback
    cb(msg)
  File "/home/rescube/r16_ws/src/teleop_tools/joy_teleop/scripts/joy_teleop.py", line 66, in joy_callback
    self.run_command(c, data)
  File "/home/rescube/r16_ws/src/teleop_tools/joy_teleop/scripts/joy_teleop.py", line 157, in run_command
    self.run_topic(command, joy_state)
  File "/home/rescube/r16_ws/src/teleop_tools/joy_teleop/scripts/joy_teleop.py", line 184, in run_topic
    val = joy_state.axes[mapping['axis']] * mapping.get('scale', 1.0) + mapping.get('offset', 0.0)
IndexError: tuple index out of range

I believe handling the situation with a message like "Joystick has no axis #3, check your configuration, or input device." would make joy_teleop user friendlier.

:)

Launch file for node?

Hi,
I am trying to use your node and I notice that there isn't any launch file nor are there instructions on how to launch the package. Is it just a hidden secret on how to launch this or...

Service Request and Action Goal Message Creation Fails for Message Types with Embedded Arrays

The function joy_teleop.fill_msg(self, msg, values) does not correctly build ROS message types of the form:

string name
geometry_msgs/Pose2D[] poses

from the the provided yaml excerpt:

  action_goal:
        name: odom
        poses:
          -   x: 2.0
              y: 0.0
              theta: 0.0
          -   x: 2.0
              y: -2.0
              theta: 0
          -  x: 0.0
              y: -2.0
              theta: 0

The code should instead use the function genpy.message.fill_message_args which will correctly load the above yaml to the message.

Translate axis to act as button

Joy node maps buttons and axes differently for example xbox controller on different OSs. Is there any way to make an axis act as a button with some kind of threshold? Or would this be outside the scope of this node?

Noetic release

Would you mind releasing these packages also for the newest distribution ROS Noetic? :)

Maybe after #43?

deadman_buttons configuration is not optional

We wanted to use a joystick without deadman switch, but removing the configuration "deadman_buttons" is not possible (the joy_teleop node crashes during startup).

It would be nice to allow configuration without the deadman_buttons.

Prebuilt packages for ROS Noetic are broken

It seems like the prebuilt packages on packages.ros.org are broken and don't contain any executables.

$ ls /opt/ros/noetic/share/key_teleop/*
/opt/ros/noetic/share/key_teleop/package.xml

/opt/ros/noetic/share/key_teleop/cmake:
key_teleopConfig-version.cmake  key_teleopConfig.cmake

The reported package size in the packages.ros.org Release file is also suspiciously small

Package: ros-noetic-key-teleop
Version: 0.4.0-1focal.20220107.000436
Architecture: amd64
Maintainer: Bence Magyar <[email protected]>
Installed-Size: 36
Depends: ros-noetic-geometry-msgs, ros-noetic-rospy
Priority: optional
Section: misc
Filename: pool/main/r/ros-noetic-key-teleop/ros-noetic-key-teleop_0.4.0-1focal.20220107.000436_amd64.deb
Size: 6948
SHA256: e74698a0f43495206e6e63ec4a6dbf1a80a815c15e21fc325fbefe7a9340883e
SHA1: 243c2f61ba6a586d7ab6e1c73166f55265fefb65
MD5sum: 7078467ce29d1bc1503f5a95b161fe5b
Description: A text-based interface to send a robot movement commands

Are there any plans to fix this or is the only way to build from source?

can't build

After cloning this package to the workspace, I get the following error when trying to build.

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_workspace.cmake:100 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
'catkin_make_isolated' command instead.
Call Stack (most recent call first):
CMakeLists.txt:69 (catkin_workspace)

-- Configuring incomplete, errors occurred!
See also "/home/ci/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ci/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

Deadman not sending stop command (joy)

I might be doing something wrong, even looking at the source code I can't figure out how to get it to work like I want:

I press button, hold down, then move the robot around with joy axes, then stop axes, robot stops release button -> all is ok.
But if I'm moving the robot with the axes, then release the button, the robot keeps moving for a while until I believe my engine controller stops moving because it stops receiving cmd_vel commands, i.e. it never receives a cmd_vel with target velocity of 0.

I was using joy_teleop before and it worked this way, the cmd_vel 0 was sent on button release.

Now this teleop tools seems more flexible and useful for me.

In any case I can send a PR to support this if it will be welcomed.

Relevant config is just this:

teleop:
  joy_move:
    type: topic
    message_type: geometry_msgs/Twist
    topic_name: cmd_vel
    deadman_buttons: [4]
    axis_mappings:
      -
        axis: 1
        target: linear.x
        scale: 0.7
      -
        axis: 0
        target: angular.z
        scale: 0.5

Compilation in ROS Melodic

Compilation in ROS Melodic

Hi!
When I try to compile it in melodic, i get the error bellow. Has anyone seen this before?

viki@viki:~/catkin_ws$ catkin build

Profile: default
Extending: [cached] /opt/ros/melodic
Workspace: /home/viki/catkin_ws

Build Space: [exists] /home/viki/catkin_ws/build
Devel Space: [exists] /home/viki/catkin_ws/devel
Install Space: [unused] /home/viki/catkin_ws/install
Log Space: [exists] /home/viki/catkin_ws/logs
Source Space: [exists] /home/viki/catkin_ws/src
DESTDIR: [unused] None

Devel Space Layout: linked
Install Space Layout: None

Additional CMake Args: None
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False

Whitelisted Packages: None
Blacklisted Packages: None

Workspace configuration appears valid.

[build] Found '18' packages in 0.0 seconds.
[build] Package table is up to date.
[build] Warning: Skipping package key_teleop because it has an unsupported package build type: ament_python
[build] Note: Available build types:
[build] - catkin
[build] - cmake
[build] Warning: Skipping package mouse_teleop because it has an unsupported package build type: ament_python
[build] Note: Available build types:
[build] - catkin
[build] - cmake
[build] Warning: Skipping package teleop_tools because it has an unsupported package build type: ament_cmake
[build] Note: Available build types:
[build] - catkin
[build] - cmake
[build] Warning: Skipping package teleop_tools_msgs because it has an unsupported package build type: ament_cmake
[build] Note: Available build types:
[build] - catkin
[build] - cmake
Abandoned <<< bebop_tools [ Depends on unknown jobs: teleop_tools_msgs ]
Abandoned <<< joy_teleop [ Depends on unknown jobs: teleop_tools_msgs ]
Starting >>> avoidance
Starting >>> bebop_description
Starting >>> bebop_msgs
Starting >>> planers
Starting >>> point_cloud_io
Starting >>> pplanner
Starting >>> simulador_uav
Finished <<< bebop_description [ 2.2 seconds ]
Finished <<< planers [ 5.4 seconds ]
Finished <<< point_cloud_io [ 6.4 seconds ]
Finished <<< simulador_uav [ 14.8 seconds ]
Finished <<< bebop_msgs [ 15.9 seconds ]
Starting >>> bebop_driver
Finished <<< pplanner [ 15.8 seconds ]
Finished <<< avoidance [ 15.9 seconds ]
Starting >>> global_planner
Starting >>> local_planner
Starting >>> safe_landing_planner
Finished <<< bebop_driver [ 3.1 seconds ]
Finished <<< safe_landing_planner [ 8.3 seconds ]
Finished <<< global_planner [ 8.8 seconds ]
Finished <<< local_planner [ 8.8 seconds ]
[build] Summary: 11 of 13 packages succeeded.
[build] Ignored: 5 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: 2 packages were abandoned.
[build] Failed: None.
[build] Runtime: 26.1 seconds total.

installing package from ros-testing broken

sudo apt-get install ros-dashing-teleop-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ros-dashing-joy-teleop ros-dashing-key-teleop ros-dashing-teleop-tools-msgs ros-dashing-trajectory-msgs
The following NEW packages will be installed:
ros-dashing-joy-teleop ros-dashing-key-teleop ros-dashing-teleop-tools ros-dashing-teleop-tools-msgs
ros-dashing-trajectory-msgs
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/390 kB of archives.
After this operation, 4,335 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package ros-dashing-teleop-tools-msgs.
(Reading database ... 390962 files and directories currently installed.)
Preparing to unpack .../ros-dashing-teleop-tools-msgs_1.0.0-0bionic.20190911.135253_amd64.deb ...
Unpacking ros-dashing-teleop-tools-msgs (1.0.0-0bionic.20190911.135253) ...
Selecting previously unselected package ros-dashing-trajectory-msgs.
Preparing to unpack .../ros-dashing-trajectory-msgs_0.7.0-1bionic.20190911.145240_amd64.deb ...
Unpacking ros-dashing-trajectory-msgs (0.7.0-1bionic.20190911.145240) ...
Selecting previously unselected package ros-dashing-joy-teleop.
Preparing to unpack .../ros-dashing-joy-teleop_1.0.0-0bionic.20190911.145914_amd64.deb ...
Unpacking ros-dashing-joy-teleop (1.0.0-0bionic.20190911.145914) ...
Preparing to unpack .../ros-dashing-key-teleop_1.0.0-0bionic.20190911.142910_amd64.deb ...
Unpacking ros-dashing-key-teleop (1.0.0-0bionic.20190911.142910) ...
dpkg: error processing archive /var/cache/apt/archives/ros-dashing-key-teleop_1.0.0-0bionic.20190911.142910_amd64.deb (--unpack):
trying to overwrite '/opt/ros/dashing/lib/python3.6/site-packages/scripts/init.py', which is also in package ros-dashing-joy-teleop 1.0.0-0bionic.20190911.145914
Selecting previously unselected package ros-dashing-teleop-tools.
Preparing to unpack .../ros-dashing-teleop-tools_1.0.0-0bionic.20190911.145955_amd64.deb ...
Unpacking ros-dashing-teleop-tools (1.0.0-0bionic.20190911.145955) ...
Errors were encountered while processing:
/var/cache/apt/archives/ros-dashing-key-teleop_1.0.0-0bionic.20190911.142910_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Branch melodic-devel disappeared?

Hi,
I was previously using branch melodic-devel but git pull on it started failing today. I also checked your branches on github and it seems like the branch is no longer there - could you please advise what to do?

Foxy: axis mapping must have offset

On foxy-devel branch, built from source, I see several warnings like this then the node dies:

joy_teleop.joy_teleop.JoyTeleopException: Axis mapping for 'walk' must have an offset

I'm loading the default example:

    parameters_file = os.path.join(
        get_package_share_directory('joy_teleop'),
        'config', 'joy_teleop_example.yaml'
    )

I can see that, indeed, that yaml file doesn't have an offset field for walk.

Reason for persistent service ??

Any particular reason for the AsyncServiceProxy to create ServiceProxy with the persistent parameter set to True by default ???

Setting this parameter to True is discouraged by the rospy doc. Moreover it seems to trigger some un-handled Interrupted system call.
My use-case is a simple start service mapped to a button. First button click goes fine, second click triggers the following crash:

On the service server side :

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 660, in handle
    requests = transport.receive_once()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 750, in receive_once
    raise TransportException("receive_once[%s]: unexpected error %s"%(self.name, str(e)))
TransportException: receive_once[/my_srv/start]: unexpected error [Errno 4] Interrupted system call

On the client side:

process[joy_teleop-1]: started with pid [945]
process[joystick-2]: started with pid [950]
Exception in thread Thread-61:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in __call__
    return self.call(*args, **kwds)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 525, in call
    raise ServiceException("transport error completing service call: %s"%(str(e)))
ServiceException: transport error completing service call: unable to receive data from sender, check sender's logs for details

When clicking a third time (and further), the error on the client side is then:

Exception in thread Thread-62:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in __call__
    return self.call(*args, **kwds)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 512, in call
    transport.send_message(request, self.seq)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 666, in send_message
    self.write_data(self.write_buff.getvalue())
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 690, in write_data
    raise TransportTerminated(str(errno)+msg)
TransportTerminated: 32Broken pipe

Quickly browsing the web, the initial issue on the server side seems to be due to a known python 2.7 feature.

Finally, setting the default value of persistent to False, everything goes fine.

joy_teleop crashes when publishing a message with header

On ROS2 foxy, joy_teleop fails to convert rclpy.Time to builtin_interfaces.msg.Time when setting the header stamp.

...
  File "/opt/ros/foxy/lib/python3.8/site-packages/joy_teleop/joy_teleop.py", line 402, in joy_callback
    command.run(self, msg)
  File "/opt/ros/foxy/lib/python3.8/site-packages/joy_teleop/joy_teleop.py", line 235, in run
    msg.header.stamp = node.get_clock().now()
  File "/opt/ros/foxy/lib/python3.8/site-packages/std_msgs/msg/_header.py", line 131, in stamp
    assert \
AssertionError: The 'stamp' field must be a sub message of type 'Time'

C++ Version & Composability with joystick_drivers

I notices that in joystick_drivers there is a Joy::Joy ROS2 component and I wonder if there is some interest/ongoing plans for a port of this repo to C++ for composability with the aforementioned joystick interface.

If no ongoing effort but there is interest, I can try to take some time, develop and contribute the port.

joy_teleop parameter namespace

In your documentation to joy_teleop you say the node is looking for the teleop param in private space (~teleop).
But from tests and looking into your code you seem to look for teleop in relative space.
I think you can fix this by changing the doc on ros wiki or changing the code in /teleop_tools/joy_teleop/scripts/joy_teleop.py in line 40 from
teleop_cfg = rospy.get_param("teleop") to teleop_cfg = rospy.get_param("~teleop").
And in line 25 check for ~teleop instead of teleop.
When looking in private space for params, maybe it would be more convinient to drop the teleop param at all and look for the name of the node as param instead (with if not rospy.has_param(rospy.get_name()): and teleop_cfg=rospy.get_param(rospy.get_name())). The rest of the code could be unchanged i think. An example .yaml would look like this then:

move:
    type: topic
    message_type: geometry_msgs/Twist
    topic_name: cmd_vel
    axis_mappings:
      -
        axis: 1
        target: linear.x
        scale: 1.0
      -
        axis: 2
        target: angular.z
        scale: 1.0

...

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.