No version for distro humble showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro jazzy showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro kilted showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro lyrical showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro rolling showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro github showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro galactic showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

No version for distro iron showing melodic. Known supported distros are highlighted in the buttons above.

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange

Package Summary

Version 3.0.1
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-10
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

ROS tools for power switching tools

Maintainers

  • Shun Hasegawa
  • Kei Okada

Authors

  • Shun Hasegawa

jsk_power_switching_tools

ROS tools for power switching tools.
Supported tools are:

USB-Serial troubleshooter

Preparation

Udev setting

This is optional, but we recommend this setting because USB-Serial troubleshooter is sometimes suddenly disconnected and its device file changes.

rosrun jsk_power_switching_tools setup_udev_for_usb_serial_troubleshooter <serial_number> <symlink_name>
# <serial_number> : The serial number of your USB-Serial troubleshooter (e.g., 001A02F2046C). You can check the serial number by "udevadm info --name=/dev/ttyACM* --attribute-walk"
# <symlink_name> : The name to create as a symbolic link in /dev (e.g., usb_serial_troubleshooter1)

Connecting USB-Serial troubleshooter

When inserting your USB-Serial troubleshooter to your PC, check if LED in the troubleshooter becomes blue after a few moments. If it remains red, the connection between the troubleshooter and the PC fails to be established. If you face this phenomenon, try the following:

  • Reversing USB-C connector of USB hub/adapter/cable if you connect the troubleshooter to a USB hub/adapter/cable connected to a USB-C port of the PC
  • Connecting the troubleshooter to a USB-A port of the PC directly (not via a USB hub)
  • Connecting the troubleshooter to a USB-C port of the PC via an adapter/cable (example)
  • Changing USB hub/adapter/cable
  • Changing the insertion process. Our experience has shown that success is more likely to be achieved if the insertion is stopped at a shallow point and then immediately deepened
  • Using USB 2.0 hub/adapter/cable. Note that you will be unable to use USB 3.0 features on the devices under the troubleshooter

Minimal usage: launching driver only

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above

Arguments

Check them by roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch --ros-args:

Required Arguments:
  port: Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
Optional Arguments:
  init_with_power_on (default "true"): Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
  init_with_power_set (default "true"): Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
  power_cycle_interval (default "1.0"): Interval [sec] in USB power cycle using USB-Serial troubleshooter
  power_cycle_service (default "~power_cycle"): Name of service for USB power cycle
  power_service (default "~power"): Name of service for USB power switching
  serial_timeout (default "1"): Timeout [sec] of serial communication with USB-Serial troubleshooter

Services

  • usb_serial_troubleshooter_driver/power (std_srvs/SetBool)

    Power on/off USB.

  • usb_serial_troubleshooter_driver/power_cycle (std_srvs/Trigger)

    Execute power cycle of USB.

Advanced usage: automated power cycle of USB

roslaunch jsk_power_switching_tools auto_power_cycle.launch troubleshooter_port:=/dev/<symlink_name> monitored_topic:=<monitored_topic> monitored_topic_expected_hz:=<monitored_topic_expected_hz> monitored_topic_respawn_delay:=<monitored_topic_respawn_delay>
# <symlink_name> : The same as above
# <monitored_topic> : Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
# <monitored_topic_expected_hz> : Expected Hz of monitored topic
# <monitored_topic_respawn_delay> : For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
#
# In default, this launch firstly executes power cycle once. If you want to change this behavior, set "init_with_power_cycle:=false"

USB PPPS hubs

“PPPS” stands for “Per-Port Power Switching” which is an advanced functionality of USB hubs. Hubs supporting PPPS (e.g., VirtualHere USB 3 4-Port Hub) are listed here.

  • Advantages compared with USB-Serial troubleshooter:
  • Disadvantages compared with USB-Serial troubleshooter:
    • Power switching is slower
    • Some devices show unexpected behavior after you command your hub to power off them
      • Power comes back on after few seconds
      • Power comes back on when the device is accessed. This behavior was observed when webcams were used on Ubuntu 20.04 (not observed on Ubuntu 24.04). This behavior is slightly different from the first behavior because the first behavior depends on no external access. The workarounds for the first behavior on Ubuntu 20.04 (i.e., Linux 5.x) mentioned in the document do not work for the second behavior

Preparation

Udev setting

This is required for running the driver node without sudo.

```bash rosrun jsk_power_switching_tools setup_udev_for_usb_ppps_hub

Reboot your PC after this script finishes

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.1 (2026-11-10)

  • Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
  • use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • jsk_power_switching_tools: add LICENSE (BSD-3-Clause) package.xml declares BSD, but there was no license text in the package (ros/rosdistro#55247 review). Same BSD 3-Clause text as the other packages of this repository. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • power_switching_tools_ros: rename to jsk_power_switching_tools (REP-144) The ROS2 release review of jsk_3rdparty in ros/rosdistro#55247 says (https://github.com/ros/rosdistro/pull/55247#issuecomment-6757867277): > - [ ] Each package meets REP-144 naming conventions. > - The 11 names other than [power_switching_tools_ros]{.title-ref} have been > released in noetic (2.1.31-4), so they're grandfathered. > - [power_switching_tools_ros]{.title-ref} is new. The [_ros]{.title-ref} suffix is for a > library wrapper; [jsk_power_switching_tools]{.title-ref} would be better. It has never been released (not in noetic either), so rename it now, before anything depends on a released name: the package, the python module (power_switching_tools_ros -> jsk_power_switching_tools) and the references in the launch files, node scripts, udev script, README and the CHANGELOG title. Older CHANGELOG entries are kept as they are. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
  • Merge pull request #571 from pazeshun/handle-slow-power-switch [power_switching_tools_ros] Handle cases where power switching tool is slow
  • [power_switching_tools_ros] Handle cases where power switching tool is slow Response from the power switching tool is very slow in some PCs (e.g., PC with many USB devices). In that case, a message of the monitored topic comes before the first power cycle when init_with_power_cycle is true. Previous implementation gets that message and wrongly considers that it came after the first power cycle. This causes unnecessary power cycle because a next message will not come just after the power cycle and that interval is considered a communication failure. This commit cuts this waste by stopping subscribing the monitored topic before the first power cycle.
  • Contributors: Kei Okada, Shun Hasegawa

3.0.0 (2026-11-06)

  • [voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] add ROS2 support Single package.xml/CMakeLists.txt branched on $ROS_VERSION, same as chaplus_ros and jsk_common's ROS2-ported packages.

    - CMakeLists.txt: the ROS2 block is prepended and the ROS1 original is wrapped in else()/endif() unchanged (no re-indentation). The python package is installed with ament_python_install_package(), the driver scripts go to lib/ with jsk_ros1_ros2_compat_install_python() (python3 shebang, jsk-ros-pkg/jsk_common#1832; a ROS2-only buildtool_depend >= 3.0.2), and scripts/ and udev/ to share/.

    - python: the original rospy code is kept as is for ROS1 users (PowerSwitchingDriverBase, UsbPppsHubDriver, UsbSerialTroubleshooterDriver and the __main__ blocks, used when jsk_ros1_ros2_compat, i.e. jsk_common >= 3.0, is not available), and PowerSwitchingDriverBaseCompat, UsbPppsHubDriverCompat and UsbSerialTroubleshooterDriverCompat are added next to them as the same code written with jsk_ros1_ros2_compat's rospy_rclpy_compat (init_node, spin, get_param, create_service, get_response_class, sleep, log*, logfatal, get_name, signal_shutdown; jsk-ros-pkg/jsk_common#1831, >= 3.0.2), which run on both ROS1 and ROS2 when jsk_ros1_ros2_compat is available. Only the imports (rospy and std_srvs' *Response classes do not exist on ROS2) and the __main__ conditions of the original lines change. The compat version of the ~hub_location/~hub_port check also treats None as missing, since ros_compat.get_param() returns the default instead of raising KeyError.

    - auto_power_cycle.py and the launch files stay ROS1-only for now: it subscribes with rospy.AnyMsg and calls the power cycle service synchronously from a timer callback, which would deadlock a single-threaded rclpy executor. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>

  • [power_switching_tools_ros] Add webcam problem to README

  • [power_switching_tools_ros] Add how to try latest uhubctl

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

  • launch/auto_power_cycle.launch
      • monitored_topic — Topic monitored for determining health of monitored communication. If this is not published for an unusually long period, power cycle of that communication occurs
      • monitored_topic_expected_hz — Expected Hz of monitored topic
      • monitored_topic_respawn_delay — For this duration [sec] after power cycle, new power cycle does not occur to wait for topic to be published
      • launch_default_driver [default: true] — Launch driver of USB-Serial troubleshooter
      • troubleshooter_port [default: /dev/ttyACM0] — Port connecting with USB-Serial troubleshooter
      • troubleshooter_serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • troubleshooter_power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • troubleshooter_init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by troubleshooter_init_with_power_on
      • troubleshooter_init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when troubleshooter_init_with_power_set is true
      • monitored_topic_allowed_delay_cycles [default: 2.0] — If monitored topic is not published in the expected timing and is delayed for ((1 / monitored_topic_expected_hz) * monitored_topic_allowed_delay_cycles) [sec], power cycle occurs
      • init_with_power_cycle [default: true] — Execute power cycle when auto_power_cycle node is initialized
  • launch/usb_ppps_hub.launch
      • hub_location — Location(s) of USB PPPS hub (e.g., '3-5', '[3-5, 2-2]', , '[3-5, 3-5]')
      • hub_port — Port(s) of USB PPPS hub you want to power on/off (e.g., '1', '[1, 1]', '[1, 2]'). Must be the same length as hub_location and each element corresponds to the element at the same position in hub_location
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB PPPS hub
      • init_with_power_set [default: true] — Set power state of USB when driver of USB PPPS hub is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB PPPS hub is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle
      • uhubctl_executable [default: uhubctl] — Command to control USB PPPS hub. You can add supplementary options to uhubctl command (e.g., 'uhubctl -r 100'). In addition, you can specify the path to uhubctl command you installed on your own (e.g., '~/uhubctl/uhubctl')
  • launch/usb_serial_troubleshooter.launch
      • port — Port connecting with USB-Serial troubleshooter (e.g., '/dev/ttyACM0')
      • serial_timeout [default: 1] — Timeout [sec] of serial communication with USB-Serial troubleshooter
      • power_cycle_interval [default: 1.0] — Interval [sec] in USB power cycle using USB-Serial troubleshooter
      • init_with_power_set [default: true] — Set power state of USB when driver of USB-Serial troubleshooter is initialized. Which state (ON or OFF) is set is defined by init_with_power_on
      • init_with_power_on [default: true] — Power on USB when driver of USB-Serial troubleshooter is initialized. This argument is valid only when init_with_power_set is true
      • power_service [default: ~power] — Name of service for USB power switching
      • power_cycle_service [default: ~power_cycle] — Name of service for USB power cycle

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jsk_power_switching_tools at Robotics Stack Exchange