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

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 ardent showing lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 bouncy showing lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 crystal showing lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 eloquent showing lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 dashing showing lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 foxy showing lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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 lunar. Known supported distros are highlighted in the buttons above.

Package Summary

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

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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.2
License BSD-3-Clause
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_3rdparty.git
VCS Type git
VCS Version master
Last Updated 2026-11-26
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 drivers of USB power switches, to power on/off or power-cycle a USB device (e.g. a camera or a serial device which hangs) by a service call, and a node which power-cycles it automatically when its topic stops. Supported tools are:

Node ROS 1 ROS 2  
usb_serial_troubleshooter_driver.py ✓ ✓ Driver of USB-Serial troubleshooter
usb_ppps_hub_driver.py ✓ ✓ Driver of USB PPPS hubs (via uhubctl)
auto_power_cycle.py ✓   Power cycle when a monitored topic stops

The launch files (launch/*.launch) are of ROS 1; on ROS 2 run the drivers with ros2 run.

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.

# ROS 1
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)

The script finds the udev rule template by rospack, so it does not work on ROS 2. There, write the rule of udev/90-usb-serial-troubleshooter.rules.template by hand:

sed -e 's/{{SERIAL}}/<serial_number>/' -e 's/{{SYMLINK}}/<symlink_name>/' \
  $(ros2 pkg prefix --share jsk_power_switching_tools)/udev/90-usb-serial-troubleshooter.rules.template \
  | sudo tee /etc/udev/rules.d/90-usb-serial-troubleshooter.rules
sudo udevadm control --reload && sudo udevadm trigger

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

ROS 2:

ros2 run jsk_power_switching_tools usb_serial_troubleshooter_driver.py --ros-args \
  -p port:=/dev/<symlink_name> -p serial_timeout:=1.0
ros2 service call /usb_serial_troubleshooter_driver/power std_srvs/srv/SetBool '{data: false}'
ros2 service call /usb_serial_troubleshooter_driver/power_cycle std_srvs/srv/Trigger

ROS 1:

roslaunch jsk_power_switching_tools usb_serial_troubleshooter.launch port:=/dev/<symlink_name>
# <symlink_name> : The same as above
rosservice call /usb_serial_troubleshooter_driver/power "data: false"
rosservice call /usb_serial_troubleshooter_driver/power_cycle

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

Advanced usage: automated power cycle of USB (ROS 1)

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"

Other arguments of auto_power_cycle.launch (check them by --ros-args): launch_default_driver (default true: run usb_serial_troubleshooter.launch), troubleshooter_serial_timeout (1), troubleshooter_power_cycle_interval (1.0), troubleshooter_init_with_power_set (true), troubleshooter_init_with_power_on (true), monitored_topic_allowed_delay_cycles (2.0) and init_with_power_cycle (true).

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package jsk_power_switching_tools

3.0.2 (2026-11-26)

  • Merge pull request #595 from k-okada/readme-update Update the READMEs for ROS 1 / ROS 2, with badges and demos
  • jsk_power_switching_tools: update README.md for ROS 1 / ROS 2 Describe how to run it on ROS 2 and ROS 1, its interface (topics, services, actions, parameters) as in the source, and its requirements. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>> Claude-Session: https://claude.ai/code/session_01Xo6jRt2Rcht9sQS6ms6A4p
  • Merge pull request #584 from k-okada/release-3.0.1
  • Contributors: Kei Okada

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

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