[jsk_rviz_plugins][jsk_rqt_plugins] ROS2 migration - #903
Open
mqcmd196 wants to merge 26 commits into
Open
Conversation
…lay linear_gauge_display normal_display normal_visual open_all_tool plotter_2d_display twist_stamped_display
Migrate the rest of the plugins whose dependencies are available in ROS 2:
- overlay: overlay_image_display, overlay_menu_display,
overlay_diagnostic_display, overlay_picker_tool
- 3D: target_visualizer_display, tf_trajectory_display,
pictogram_display, pictogram_array_display
- tool/display: screenshot_listener_tool, quiet_interactive_marker_display,
video_capture_display, rviz_scene_publisher
- panel: record_action, object_fit_operator, robot_command_interface,
select_point_cloud_publish_action, tablet_controller_panel
- shared helpers: facing_visualizer, image_transport_hints_property
Generate msg/srv with rosidl_auto_generate_interfaces(). It reserves the
${PROJECT_NAME} target name, so the plugin library target is renamed to
${PROJECT_NAME}_plugins and OUTPUT_NAME keeps libjsk_rviz_plugins.so.
Link opencv_videoio explicitly since cv_bridge does not export it, which
left cv::VideoWriter undefined in video_capture_display.
Behaviour changes forced by the ROS 2 APIs:
- robot_command_interface takes a list of button ids plus per-id parameter
groups because ROS 2 parameters cannot hold an array of structs
- ImageTransportHintsProperty returns the transport as a plain string
- overlay_picker_tool picks String/LinearGauge instead of OverlayText/PieChart
Not ported, documented in CMakeLists.txt:
- already upstream: overlay_text_display, pie_chart_display
(rviz_2d_overlay_plugins), camera_info_display, pose_array_display
(rviz_default_plugins)
- waiting for upstream packages: ambient_sound*, footstep_display,
bounding_box*, torus_array, segment_array, human_skeleton_array,
polygon_array, simple_occupancy_grid_array,
people_position_measurement_array, tablet_view_controller,
yes_no_button_interface
- overlay_camera_display: rviz_rendering does not expose the Ogre render
target behind RenderPanel::getRenderWindow()
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
add_rostest() has no ROS 2 counterpart, so the rviz crash tests are rewritten
as launch tests registered with add_launch_test() from launch_testing_ament_cmake.
test/rviz_config_check.py keeps checking the same three things as the ROS 1
rostest node: the rviz node shows up, it stays alive for test_duration seconds
and it ends up subscribing to the expected topics. It is a plain mixin rather
than a unittest.TestCase so that importing it does not make launch_testing run
it on its own. The rviz node is now looked up by its node name (rviz2 always
names it `rviz`) instead of the ROS 1 rviz/SendFilePath service, and the
subscription list comes from get_subscriber_names_and_types_by_node() instead
of the rosmaster system state.
Tests, mirroring the ROS 1 test names:
- test_overlay.py (overlay.test)
- test_linear_gauge.py (linear_gauge_test.test)
- test_service_call_panel.py (service_call_panel.test)
- test_robot_command_interface.py (robot_command_interface.test)
- test_pictogram.py (new, ROS 1 had no pictogram test)
Each also gets a post_shutdown_test asserting rviz did not crash on exit.
Supporting assets the tests need:
- launch/*.launch.py for the five samples
- config/*.rviz converted to the rviz2 format with the migrated jsk classes
- samples/{overlay,overlay_menu,piechart,pictogram}_sample.py ported to rclpy
- config/{command_samples,default_robot_command}.yaml in the ROS 2 parameter
layout the migrated panels expect
- install config/, icons/, launch/ and the sample scripts
ROS 1 forced DISPLAY to :0.0; the tests instead skip themselves when DISPLAY is
unset so that a headless run does not report false failures. Run them under
`xvfb-run -a colcon test ...` to exercise them without a display.
Still not ported, because the plugins or scripts they cover are not migrated
yet: boundingbox, polygon_array, segment_array, contact_state_marker,
link_marker_publisher, piechart (upstream), normal/face_detector (need the
sample bag) and the test_overlay_text_interface/point_test python unit tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
mqcmd196
force-pushed
the
rviz-plugins-ros2
branch
from
July 28, 2026 14:00
cc5cca1 to
7e2af09
Compare
mqcmd196
force-pushed
the
rviz-plugins-ros2
branch
from
July 28, 2026 14:15
c276273 to
0a78d94
Compare
Convert the package to ament_cmake + ament_cmake_python and port the plugins whose dependencies are available in ROS 2: - ServiceButtons, ServiceRadioButtons, ServiceTabbedButtons - StringLabel, StatusLight - Plot3D, DRCEnvironmentViewer ROS 1 had the shared pieces sitting in modules that pull in unmigrated dependencies: label.py took ROSData from hist.py (jsk_recognition_msgs) and status_light.py took ComboBoxDialog from image_view2_wrapper.py (image_view2). ROSData now lives in util.py and the dialogs in a new dialogs.py, so the migrated plugins no longer depend on the blocked ones. API changes forced by ROS 2: - rospy -> rclpy, the node comes from context.node and is passed to the widgets - roslib.message.get_message_class -> rosidl_runtime_py.utilities.get_message, and the field type strings are now 'sequence<T>' instead of 'T[]' - rospkg / package:// -> ament_index_python / resource_retriever - rosservice + ServiceProxy -> create_client with an explicit timeout - rqt_py_common.topic_helpers.is_slot_numeric -> rqt_plot.plot_widget.is_plottable - rosgraph.names.script_resolve_name -> local resolver, as ROS 2 rqt_plot does - std_msgs/Time does not exist any more, mini_maxwell uses builtin_interfaces/Time (which is the stamp itself, not a `data` field) - the Qt4 branches and the distutils.LooseVersion checks are gone - ServiceButtons/ServiceTabbedButtons read their layout from flat parameters, because ROS 2 parameters cannot hold nested structures Bugs found while bringing the plugins up: - the topic-poll QTimers outlived the rclpy context and threw RCLError on shutdown; the plugins now implement shutdown_plugin() - rclpy.node.Node already defines a read-only `services` property, which broke the sample service nodes - matplotlib >= 3.6 raises on 3d axes drawn at a non-positive size, which made Plot3D spam tracebacks until its window was mapped - ROS 2's ROSData needs the topic type at subscribe time, so a topic given on the command line was silently dropped when its publisher was not discovered yet; the initial topics are retried now Tests: test_rqt_plugins.test becomes a launch test (launch_testing) covering the migrated plugins, test_util.py becomes a pytest. The launch test skips itself when DISPLAY is unset; run it under `xvfb-run -a colcon test ...`. Not ported, documented in CMakeLists.txt: HistogramPlot and Plot2D (jsk_recognition_msgs), ImageView2Plugin (image_view2) and YesNoButton (jsk_gui_msgs), together with their bin/ entry points and samples. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
Remove the ROS 1 rostest files whose ROS 2 launch_testing counterparts are in
place, together with the sample launch files they included:
jsk_rviz_plugins
test/overlay.test -> test/test_overlay.py
test/linear_gauge_test.test -> test/test_linear_gauge.py
test/robot_command_interface.test -> test/test_robot_command_interface.py
test/service_call_panel.test -> test/test_service_call_panel.py
launch/{overlay_sample,linear_gauge_sample,pictogram_sample,
robot_command_interface_sample,service_call_panel}.launch
-> the matching *.launch.py
jsk_rqt_plugins
test/test_rqt_plugins.test -> test/test_rqt_plugins.py
test/piechart.test and launch/piechart_sample.launch go as well: PieChart is
provided by rviz_2d_overlay_plugins in ROS 2, so nothing in this package can
satisfy them any more.
The rostest files of the plugins that are still blocked on unmigrated upstream
packages are kept as the reference for porting them later: boundingbox,
polygon_array, segment_array, contact_state_marker, link_marker_publisher,
normal, face_detector and test_overlay_text_interface.
Also commits the removal of the commented-out catkin dependency block from
jsk_rviz_plugins/package.xml.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
mqcmd196
force-pushed
the
rviz-plugins-ros2
branch
from
July 29, 2026 00:10
09f0c15 to
e93ed70
Compare
image_transport 7 (rolling; jazzy has 5.1.8 and lyrical 6.4.10) changed both free functions this package uses: - the first parameter is a rclcpp node interfaces object instead of a rclcpp::Node*. It is built from a node reference, so the node is dereferenced at the call site - custom_qos became a required rclcpp::QoS with no default value There is no single expression that satisfies both signatures: passing *node_ and rclcpp::QoS(10) unconditionally fails on jazzy with "cannot convert 'rclcpp::Node' to 'rclcpp::Node*'", so the call sites are guarded with IMAGE_TRANSPORT_VERSION_GTE(7, 0, 0). QoS(10) reproduces the rmw_qos_profile_default the older signature defaulted to, which keeps the QoS identical across distros; rclcpp::SystemDefaultsQoS() would instead leave every policy to the RMW and change the behaviour on rolling only. Verified by building and testing the workspace in a ros:rolling-ros-base container with the same steps industrial_ci runs: 2 packages built, 23 tests, 0 errors, 0 failures, 14 skipped (launch tests, no DISPLAY). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
mqcmd196
force-pushed
the
rviz-plugins-ros2
branch
from
July 29, 2026 05:21
a188f7c to
171281f
Compare
Drop the descriptions of what the ROS 1 rostest counterparts used to do; they say nothing about the code that is here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
rclpy dropped Logger.warn() after jazzy, so label.py raised AttributeError on lyrical and rolling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
The tests skip themselves without a display, so nothing was exercised on CI. industrial_ci runs the BEFORE_RUN_TARGET_TEST hook in a sub shell, hence the _EMBED variant, which is eval'd in the shell that runs the tests. Under software OpenGL the processes corrupt the heap while tearing down their Fast DDS subscriptions and die from SIGABRT, so the post shutdown tests accept that. It happens on lyrical and rolling, not on jazzy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
mqcmd196
force-pushed
the
rviz-plugins-ros2
branch
from
July 29, 2026 11:06
b4f9d74 to
6537a7b
Compare
…lib backend Qt6, which rviz and rqt are built against from lyrical on, dropped the unscoped enum members and the PyQt5 binding matplotlib.backends.backend_qt5agg needs. Both replacements also work with the Qt5 of jazzy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
Qt6 moved it from QtWidgets to QtGui. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
… on exit rqt_plot renamed ROSData.next() to next_data() after jazzy, which left the plot and the label without data on lyrical and rolling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BmCHFJ43AcU7UNwuW2Fz4a
mqcmd196
marked this pull request as ready for review
July 29, 2026 12:12
Member
Author
|
@k-okada jsk_rviz_plugins and jsk_rqt_plugins are ready for release. You can test them in local by |
Member
Author
|
Features that depend on unreleased upstream packages or have been merged into upstream are skipped during the migration and are noted as comments in CMakeLists.txt. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.