Giter Club home page Giter Club logo

topic_tools's People

Contributors

andrewbest-tri avatar anrp-tri avatar bartek-kc avatar bitterisland6 avatar christophebedard avatar dependabot[bot] avatar emersonknapp avatar esteve avatar haoguangyang avatar jaagut avatar kettenhoax avatar martimorta-at-work avatar mateusz-lichota avatar michaelorlov avatar mllofriu avatar simutisernestas avatar smnogar avatar wep21 avatar wmmc88 avatar ymd-stella 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

topic_tools's Issues

Bloom to Galactic/Rolling

Hello,

Are the binaries for these packages available? I know, this is a feature request channel, but was not sure where to ask for it..

Implement a priority mux

Description

Implement a priority multiplexer like cmd_vel_mux (https://github.com/kobuki-base/cmd_vel_mux/blob/devel/src/cmd_vel_mux.cpp) for generic topic types. The multiplexer would give preference to the highest priority topic that published within a given time window, suppressing all other topics.

Note that this tool would replace cmd_vel_mux, but allow for uses with other topic types.

We are currently pursuing the implementation of input/output suppressors/inhibitors, as described in the subsumtion architecture, as described in here:

https://people.csail.mit.edu/brooks/papers/AIM-864.pdf

This other paper claims to have implemented it in ROS (1) but no source is available:

file:///home/mllofriu/Downloads/Subsumption%20Model%20Implemented%20on%20ROS%20for%20Mobile%20Robots%20_Li16.pdf

Completion Criteria

A new tool, say priority_mux, is implemented.

It allows to specify a list of topics of a generic, but equal, type. The order in which topics are published determines their relative priority, the first one being the highest priority one.

It contains a parameter that specifies the length of the time window, T, in seconds. Once an input topic publishes a message which is forwarded by the multiplexer, all lower priority topics will be suppressed for T seconds. Any topics with a higher priority topics, however, can be forwarded right away.

Implementation Notes / Suggestions

The feature could be implemented by combining features from topic_tools/mux and cmd_vel_mux. The services and selection logic can be stripped from mux, and the time window logic can be migrated from cmd_vel_mux.

We can certainly help implement or implement it. We just wanted to check if it is something this team would be interested in incorporating to topic_tools. As well as to check if you maybe know any other existing tool that can be used for this purpose.

Foxy Implementation

Hello,

Just curious how to use this with ros2 foxy, I run into issues when cloning the repo and building from source.

best regards

[Question] Support for Foxy

Is this package supported for ROS2 - Foxy? I assumed it is because it does not say other wise. But I am unable to build it with foxy? There is no branch for Foxy either. Please clarify if this is indeed supported for foxy or not?

Segmentation fault [ros2run]

Description

Segmentation fault occurring when stopping the publisher and restarting while keeping the ros2 run topic throttle message active.

In two separate terminals, publish two messages
$ ros2 topic pub -r 10 /greetings std_msgs/msg/String "{data: 'Hello from terminal'}"
$ ros2 topic pub -r 10 /welcome std_msgs/msg/String "{data: 'Hello from terminal'}"

In two new terminals, run the commands,
$ ros2 run topic_tools throttle messages /greetings 1
$ ros2 run topic_tools throttle messages /welcome 1

on doing a ros2 topic list, the following topics are visible:
/greetings
/greetings_throttle
/parameter_events
/rosout
/welcome
/welcome_throttle

Press control + c in terminal two (or in one) where the $ ros2 topic pub -r 10 /welcome std_msgs/msg/String "{data: 'Hello from terminal'}" was entered.

and rerun the command again.

Expected Behavior

** clear and concise description of what you expected to happen **

Actual Behavior

** clear and concise description of what actually happened. include copied logs whenever possible **
In the terminal where the following command was entered, $ ros2 run topic_tools throttle messages /welcome
the following occurred.
[ros2run]: Segmentation fault

System (please complete the following information)

  • OS: Ubuntu 22.04
  • ROS 2 Distro: Humble

Is there any chance to keep the throttle active and connect again without segmentation fault when the topic starts to publish again?

Additional info
Traceback (most recent call last):
File "/opt/ros/humble/bin/ros2", line 33, in
sys.exit(load_entry_point('ros2cli==0.18.5', 'console_scripts', 'ros2')())
File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 89, in main
rc = extension.main(parser=parser, args=args)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/command/topic.py", line 41, in main
return extension.main(args=args)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/hz.py", line 89, in main
return main(args)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/hz.py", line 104, in main
_rostopic_hz(node.node, topic, window_size=args.window_size, filter_expr=filter_expr,
File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/hz.py", line 274, in _rostopic_hz
rt.print_hz(topic)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/hz.py", line 244, in print_hz
print('average rate: %.3f\n\tmin: %.3fs max: %.3fs std dev: %.5fs window: %s'
BrokenPipeError: [Errno 32] Broken pipe

Thanks

transform is broken with relative topics in namespaces

Description

The transform tool fails to properly resolve the names of topics specified as relative to a non-root namespace.

Expected Behavior

Tool runs, subscribes to /my_namespace/chatter and emits /my_namespace/xformed.

Actual Behavior

Tool stalls with:

WARNING: topic [/my_namespacechatter] does not appear to be published yet

To Reproduce

  1. ros2 run demo_nodes_cpp talker --ros-args -r __ns:=/my_namespace
  2. ros2 run topic_tools transform chatter xformed std_msgs/String "std_msgs.msg.String(data=m.data[-1])" --import std_msgs --wait-for-start --ros-args -r __ns:=/my_namespace

System (please complete the following information)

  • OS: Ubuntu Jammy
  • ROS 2 Distro: Iron

Additional context

Release more recent version

hello,

I experienced a bug with mux only to find that it was fixed already in the iron branch. The released version is quite old:

root@logi-XMG-CORE-REN-M20:/code# apt install ros-iron-topic-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ros-iron-topic-tools is already the newest version (1.0.0-3jammy.20230908.173839).

The 1.0.0 tag is from March 2022.

Can you please release a more recent tag? Thanks

Port demux

Description

Basically porting https://github.com/ros/ros_comm/blob/noetic-devel/tools/topic_tools/src/demux.cpp to ROS2

demux is a generic ROS topic demultiplexer: one input topic is fanned out to 1 of N output topics. A service is provided to select between the outputs

Completion Criteria

ros2 run topic_tools demux <intopic> <outtopic1> [outtopic2...]
  • select service
  • add service
  • delete service
  • list service

Implementation Notes / Suggestions

Might be a good first issue since the ROS1 version already exists and this is very similar to Mux which has already been ported to ROS2.

Testing Notes / Suggestions

It seems the original ROS1 code also didn't have any unit tests for demux

Branch Humble and Iron release branches, make sure they build

Right now this package was released into Humble and Iron pointing to the main branch - there's no guarantee this code will continue to build in those distros if we keep building against Rolling.

We should create dedicated release branches for those distros and fix them if necessary to build in those environments, then update rosdistro with a new patch release pointing to the proper branches.

Add `mux` - topic multiplexer

Description

See topic_tools documentation https://github.com/ros-tooling/topic_tools/issues/new?assignees=&labels=enhancement&template=feature_request.md&title= - we should try to adhever

Related Issues

N/A

Completion Criteria

  • Can invoke with N in_topics and one outtopic
  • Publishes currently selected input to ~/selected
  • Service ~/select selects the active input topic
  • Service ~/add adds a new input topic
  • Service ~/delete removes an input topic
  • Parameter ~lazy - if True, don't subscribe to input topic unless there is at least one subscriber on the output topic
  • Parameter ~initial_topic selects the initial choice for input, if unset, default to first topic in arguments.

Implementation Notes / Suggestions

  • Use rclcpp::GenericSubscription / rclcpp::GenericPublisher to get generics.
  • Use component nodes and create the executable, so that it can be both composed and invoked from ros2 run

Testing Notes / Suggestions

  • Maybe use launch_testing to test compositiion
  • Simple unit test on the Node itself should also be fine

Use ROS parameters in transform

Description

It would be immensly helpful to be able to set the parameters of transform via a yaml parameter file. For example, in a launch file:

Node(
        package='topic_tools',
        executable='transform_node.py',
        name='transform',
        output='screen',
        parameters=[
            {'input': '/conemap'},
            {'output-topic': '/conemap_rviz'},
            {'output-type': 'visualization_msgs/MarkerArray'},
            {'expression': 'conemap_to_markerarray.convert(m)'},
            {'import': ['conemap_to_markerarray']}
        ])

This way one can make a pip-installable python package, and withou worrying about any ROS implementation details just run it as a very simple ros node. I have a working implementation of this feature in my fork, although I'm a newbie to ros and it's probably full of bugs etc

Completion Criteria

You can use both command line arguments and ros parameters to alter transform settings.

Support operations on synchronized topics

Description

I would like this package to allow operations on synced topics. The use case that I'm thinking of is when the inputs are coming from a camera, ie, camera_info and image_raw topics.
In this case, throttle may drop/throttle messages on one topic, but for different timestamps for the other topic. Hence the outputs are throttled but the downstream exact sync of the throttled messages will fail.

Are there any efforts to enable doing the same operation on synced topics?

`throttle`: multiple input topics through a single terminal command

Description

Currently throttle takes only one input topic (intopic in the readme). Able being to pass in multiple intopic's can be a useful enhancement.

Possible use case: through a single terminal command, throttle RGB and depth data coming in from an RGBD camera.

Related Issues

None.

Completion Criteria

  • Can throttle n input topics in parallel and publish on n output topics.

Implementation Notes / Suggestions

Spinning n threads, one for each intopic-outtopic pair. n should probably have a cap but not entirely sure what's a good way to decide on the number.

Testing Notes / Suggestions

  • Units tests that can verify throttling of n >= 1 topics.

Foxy build failure

Description

Foxy build fails with a CMake Error.

  ament_python_install_package() called with unused arguments:
  SETUP_CFG;topic_tools/setup.cfg

Expected Behavior

Foxy build does not fail.

Actual Behavior

Foxy build fails.

To Reproduce

  1. Add this topic_tools repo to an existing Foxy colcon/ament workspace.
  2. colcon build

System (please complete the following information)

  • OS: Ubuntu Focal
  • ROS 2 Distro: Foxy
# git log -n1
commit 41511029241805da470beb77703d7c3ef1801141 (HEAD -> main, origin/main, origin/HEAD)
Author: Daisuke Nishimatsu <[email protected]>
Date:   Tue Nov 30 08:37:28 2021 +0900

    Workaround for galactic build (#18)

    Signed-off-by: wep21 <[email protected]>

Additional context

# colcon build --packages-up-to topic_tools
Starting >>> topic_tools
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
Not searching for unused variables given on the command line.                                                                                                             [0/91149]
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ament_cmake_auto: 0.9.9 (/opt/ros/foxy/share/ament_cmake_auto/cmake)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3")
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c
-- Found rosidl_adapter: 1.2.1 (/opt/ros/foxy/share/rosidl_adapter/cmake)
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f")
-- Found FastRTPS: /opt/ros/foxy/include
-- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp
-- Found rmw_implementation_cmake: 1.0.3 (/opt/ros/foxy/share/rmw_implementation_cmake/cmake)
-- Using RMW implementation 'rmw_fastrtps_cpp' as default
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at /opt/ros/foxy/share/ament_cmake_python/cmake/ament_python_install_package.cmake:34 (message):
  ament_python_install_package() called with unused arguments:
  SETUP_CFG;topic_tools/setup.cfg
Call Stack (most recent call first):
  /opt/ros/foxy/share/ament_cmake_python/cmake/ament_python_install_package.cmake:28 (_ament_cmake_python_install_package)
  CMakeLists.txt:24 (ament_python_install_package)


-- Configuring incomplete, errors occurred!
See also "/root/colcon_ws/build/topic_tools/CMakeFiles/CMakeOutput.log".
See also "/root/colcon_ws/build/topic_tools/CMakeFiles/CMakeError.log".
--- stderr: topic_tools
CMake Error at /opt/ros/foxy/share/ament_cmake_python/cmake/ament_python_install_package.cmake:34 (message):
  ament_python_install_package() called with unused arguments:
  SETUP_CFG;topic_tools/setup.cfg
Call Stack (most recent call first):
  /opt/ros/foxy/share/ament_cmake_python/cmake/ament_python_install_package.cmake:28 (_ament_cmake_python_install_package)
  CMakeLists.txt:24 (ament_python_install_package)


---
Failed   <<< topic_tools [5.82s, exited with code 1]

Summary: 0 packages finished [7.84s]
  1 package failed: topic_tools
  1 package had stderr output: topic_tools

Add `relay` tool

Description

See http://wiki.ros.org/topic_tools/relay

Relay an input topic to a different output topic, with some configuration

Related Issues

N/A

Completion Criteria

  • Callable via CLI and as a composed component
  • Parameter ~lazy - don't subscribe to input topic unless there is at least one subscriber on the output topic
  • (optional) "stealth mode" as laid out in http://wiki.ros.org/topic_tools/relay - this could be an appropriate followup after the initial implementation, maybe there would be a way to make RViz encourage "laziness" without having to add a relay.

Implementation Notes / Suggestions

  • Use rclcpp::GenericPublisher/Subscription

Testing Notes / Suggestions

  • Unit testing for the Node

`KeyboardInterrupt` exception on shutdown

Description

KeyboardInterrupt exception on shutdown

Expected Behavior

Clean shutdown

Actual Behavior

[relay_field-69] Traceback (most recent call last):
[relay_field-69]   File "/opt/ros/iron/lib/topic_tools/relay_field", line 33, in <module>
[relay_field-69]     sys.exit(load_entry_point('topic-tools==1.2.0', 'console_scripts', 'relay_field')())
[relay_field-69]   File "/opt/ros/iron/lib/python3.10/site-packages/topic_tools/relay_field.py", line 226, in main
[relay_field-69]     node.destroy_node()
[relay_field-69]   File "/opt/ros/iron/lib/python3.10/site-packages/rclpy/node.py", line 1887, in destroy_node
[relay_field-69]     self.__node.destroy_when_not_in_use()
[relay_field-69] KeyboardInterrupt

To Reproduce

** Steps to reproduce the behavior, e.g.

  1. ros2 topic pub /chatter std_msgs/String "{}"
  2. ros2 run topic_tools relay_field /chatter /chatter2 std_msgs/String "{data: m.data}"
  3. Press ctrl+C
  4. Watch error

System (please complete the following information)

  • OS: Ubuntu
  • ROS 2 Distro: Iron

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.