diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 43bc0f7..0f85b3a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,7 +10,8 @@ Forthcoming * Add startup confirmation, feedback timeout handling, repeated shutdown commands, and a motor-side CAN watchdog. * Add compatibility with ROS 2 Humble, Jazzy, Kilted, Lyrical, and Rolling. -* Use ros2_socketcan topics for CAN transport. +* Use ``can_msgs/msg/Frame`` topics for CAN transport; the example launch uses + ``ros2_socketcan`` as its bridge. * Move periodic motion-frame publication to a latest-value transport thread so the controller update loop cannot accumulate stale commands before DDS publication. * Serialize all outbound frames through one DDS DataWriter and invalidate diff --git a/README.ja.md b/README.ja.md index 2c5117a..0468ae8 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,7 +1,7 @@ # robstride_ros2 RobStrideアクチュエータをprivate CAN protocolで制御する、非公式・コミュニティ管理のROS 2 `ros2_control` Hardware Componentです。 -CAN frameの送受信には[`ros2_socketcan`](https://github.com/autowarefoundation/ros2_socketcan)が提供する`can_msgs/msg/Frame` topicを使用します。 +CAN frameの送受信には`can_msgs/msg/Frame` topicを使用します。core packageは`can_msgs`に依存し、特定のSocketCAN bridgeを必要としません。 本プロジェクトはRobStride社とは提携しておらず、同社による承認を受けたものではありません。protocolと型番別profileは、RobStride公式[`Product_Information`](https://github.com/RobStride/Product_Information) repositoryの英語版manualと照合しています。英語版READMEは[`README.md`](README.md)を参照してください。 @@ -22,13 +22,23 @@ repositoryには4つのROS 2 packageが含まれます。 | package | 役割 | |---|---| -| `robstride_driver` | CAN通信、モーター指令、feedback、復旧処理 | +| `robstride_driver` | private protocolと`can_msgs` topic transport | | `robstride_ros2_control` | `ros2_control` Hardware Component | | `robstride_examples` | 型番別Xacro、controller設定、example launch | | `robstride_ros2` | 上記packageをまとめてインストールするaggregate package | 既存のrobot descriptionとの互換性を保つため、plugin IDは`robstride_ros2/RobStrideSystem`を使用します。 +## CAN bridgeとの互換性 + +`robstride_driver`と`robstride_ros2_control`は`can_msgs/msg/Frame` topicだけを使って通信します。互換性のある送受信topicを提供するCAN bridgeであれば、`ros2_socketcan`以外とも組み合わせられます。 + +[`ros2_socketcan`](https://github.com/autowarefoundation/ros2_socketcan)へ直接依存するのは、そのbridgeを起動するlaunchを含む`robstride_examples`だけです。aggregate packageの`robstride_ros2`はexampleもまとめてインストールします。bridge非依存のHardware Componentとdriverだけをインストールする場合は、`robstride_ros2_control`までをbuildします。 + +```bash +colcon build --packages-up-to robstride_ros2_control --symlink-install +``` + ## 対応ROS 2ディストリビューション 同じsource branchで以下のROS 2ディストリビューションに対応し、それぞれのTier 1 Ubuntu環境でCIを実行します。 @@ -110,8 +120,8 @@ ros2 topic pub --rate 20 \ | parameter | default | 説明 | |---|---:|---| | `host_can_id` | `253` | host CAN ID。範囲は`0..255` | -| `can_tx_topic` | `to_can_bus` | `ros2_socketcan`へ送るframeのtopic | -| `can_rx_topic` | `from_can_bus` | `ros2_socketcan`から受け取るframeのtopic | +| `can_tx_topic` | `to_can_bus` | 送信する`can_msgs/msg/Frame` topic | +| `can_rx_topic` | `from_can_bus` | 受信する`can_msgs/msg/Frame` topic | | `can_rx_qos_depth` | `32` | reliable・volatileなfeedback QoS depth。多数のモーターを使う場合は増加を検討 | | `feedback_timeout_ms` | `3000` | feedbackを受信できない状態でERRORを返すまでの時間 | | `fail_on_feedback_timeout` | `true` | feedback timeout時にHardwareを停止 | @@ -122,7 +132,7 @@ ros2 topic pub --rate 20 \ | `shutdown_stop_repetitions` | `3` | 終了時にゼロ指令と停止指令を送る回数 | | `shutdown_stop_interval_ms` | `20` | ゼロ指令と停止指令の送信セット間隔 | | `shutdown_confirmation_timeout_ms` | `300` | Reset modeのfeedbackを待つ時間。`0`で確認を無効化 | -| `startup_connection_timeout_ms` | `3000` | `ros2_socketcan`のtopic endpointを待つ時間 | +| `startup_connection_timeout_ms` | `3000` | CAN bridgeのtopic endpointを待つ時間 | | `startup_confirmation_timeout_ms` | `500` | parameterと有効化確認の1試行あたりのtimeout | | `startup_retries` | `3` | 起動時のparameter設定と有効化の最大試行回数 | diff --git a/README.md b/README.md index 550cfee..8bbd402 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ An unofficial, community-maintained ROS 2 `ros2_control` hardware component for RobStride actuators using the RobStride private CAN protocol. -CAN frames are exchanged through the `can_msgs/msg/Frame` topics provided by -[`ros2_socketcan`](https://github.com/autowarefoundation/ros2_socketcan). +CAN frames are exchanged through `can_msgs/msg/Frame` topics. The core packages +depend on `can_msgs` and do not require a specific SocketCAN bridge. This project is not affiliated with or endorsed by RobStride. The protocol and model profiles were checked against the English manuals in RobStride's official @@ -28,7 +28,7 @@ The repository contains four ROS 2 packages: | Package | Responsibility | |---|---| -| `robstride_driver` | CAN communication, motor commands, feedback, and recovery | +| `robstride_driver` | Private protocol and `can_msgs` topic transport | | `robstride_ros2_control` | `ros2_control` Hardware Component | | `robstride_examples` | Motor-profile Xacro, controller configuration, and example launch | | `robstride_ros2` | Installs the complete set of packages | @@ -36,6 +36,22 @@ The repository contains four ROS 2 packages: The plugin identifier `robstride_ros2/RobStrideSystem` remains compatible with existing robot descriptions. +## CAN bridge compatibility + +`robstride_driver` and `robstride_ros2_control` communicate only through +`can_msgs/msg/Frame` topics. They can be used with any CAN bridge that provides +compatible transmit and receive topics. + +`robstride_examples` is the only package that directly depends on +[`ros2_socketcan`](https://github.com/autowarefoundation/ros2_socketcan), because +its example launch starts that bridge. The aggregate `robstride_ros2` package +installs the examples as well. To install only the bridge-independent Hardware +Component and driver, build through `robstride_ros2_control`: + +```bash +colcon build --packages-up-to robstride_ros2_control --symlink-install +``` + ## Supported ROS 2 distributions The same source branch targets all currently supported ROS 2 distributions. @@ -133,8 +149,8 @@ description. | Parameter | Default | Description | |---|---:|---| | `host_can_id` | `253` | Host CAN ID in the range `0..255` | -| `can_tx_topic` | `to_can_bus` | Frames sent to `ros2_socketcan` | -| `can_rx_topic` | `from_can_bus` | Frames received from `ros2_socketcan` | +| `can_tx_topic` | `to_can_bus` | Outgoing `can_msgs/msg/Frame` topic | +| `can_rx_topic` | `from_can_bus` | Incoming `can_msgs/msg/Frame` topic | | `can_rx_qos_depth` | `32` | Reliable, volatile feedback QoS depth; increase for large motor groups | | `feedback_timeout_ms` | `3000` | Maximum time without motor feedback before returning ERROR | | `fail_on_feedback_timeout` | `true` | Stop the hardware when feedback times out | @@ -145,7 +161,7 @@ description. | `shutdown_stop_repetitions` | `3` | Number of zero and stop commands sent at shutdown | | `shutdown_stop_interval_ms` | `20` | Delay between repeated shutdown frames | | `shutdown_confirmation_timeout_ms` | `300` | Wait for Reset mode feedback; `0` disables confirmation | -| `startup_connection_timeout_ms` | `3000` | Wait for the `ros2_socketcan` topic endpoints | +| `startup_connection_timeout_ms` | `3000` | Wait for the CAN bridge topic endpoints | | `startup_confirmation_timeout_ms` | `500` | Per-attempt parameter and enable confirmation timeout | | `startup_retries` | `3` | Number of startup parameter and enable attempts | diff --git a/robstride_driver/src/driver.cpp b/robstride_driver/src/driver.cpp index c54bd7b..b42af8c 100644 --- a/robstride_driver/src/driver.cpp +++ b/robstride_driver/src/driver.cpp @@ -92,7 +92,7 @@ bool RobStrideDriver::start() { if (!transport_ || !transport_->wait_for_endpoints(settings_.connection_timeout)) { RCLCPP_ERROR( - logger_, "Timed out waiting for ros2_socketcan endpoints on '%s' and '%s'", + logger_, "Timed out waiting for CAN bridge endpoints on '%s' and '%s'", settings_.transport.transmit_topic.c_str(), settings_.transport.receive_topic.c_str()); return false; } diff --git a/robstride_ros2_control/robstride_hardware.xml b/robstride_ros2_control/robstride_hardware.xml index 1d85e34..bba62ce 100644 --- a/robstride_ros2_control/robstride_hardware.xml +++ b/robstride_ros2_control/robstride_hardware.xml @@ -3,6 +3,6 @@ name="robstride_ros2/RobStrideSystem" type="robstride_ros2_control::RobStrideSystem" base_class_type="hardware_interface::SystemInterface"> - RobStride private-CAN protocol system using ros2_socketcan topics. + RobStride private-CAN protocol system using can_msgs topics.