From bc8a2633c0ea9181f720d827e1d8a330f7fb5b8c Mon Sep 17 00:00:00 2001 From: ipa-vsp Date: Tue, 23 Apr 2024 12:49:48 +0200 Subject: [PATCH 01/10] update operation and configuration section --- canopen/sphinx/index.rst | 2 +- canopen/sphinx/quickstart/installation.rst | 12 ++ .../{operation.rst => setup-network.rst} | 0 canopen/sphinx/user-guide/configuration.rst | 40 +++---- canopen/sphinx/user-guide/operation.rst | 107 ++++++++++-------- .../operation/managed-service-interface.rst | 62 +++++----- .../operation/ros2-control-interface.rst | 55 ++++----- 7 files changed, 141 insertions(+), 137 deletions(-) rename canopen/sphinx/quickstart/{operation.rst => setup-network.rst} (100%) diff --git a/canopen/sphinx/index.rst b/canopen/sphinx/index.rst index 01a3abc0d..178fca322 100644 --- a/canopen/sphinx/index.rst +++ b/canopen/sphinx/index.rst @@ -9,7 +9,7 @@ This is the documentation of the ROS2 CANopen stack. :glob: quickstart/installation - quickstart/operation + quickstart/setup-network quickstart/examples .. toctree:: diff --git a/canopen/sphinx/quickstart/installation.rst b/canopen/sphinx/quickstart/installation.rst index 35fc07c8d..272af3a23 100644 --- a/canopen/sphinx/quickstart/installation.rst +++ b/canopen/sphinx/quickstart/installation.rst @@ -9,3 +9,15 @@ build with colcon and your done. $ cd .. $ rosdep install --from-paths src/ros2_canopen --ignore-src -r -y $ colcon build + +Testing with pre-release binaries +--------------------------------- +To test the package with pre-release binaries, you must first set up your ROS2 workspace to use the ROS2 pre-release repositories. +To do this, follow the instructions [here](https://docs.ros.org/en/rolling/Installation/Testing.html#debian-testing-repository). + +After that, you can install the packages using the following command, + +.. code-block:: console + + $ sudo apt update + $ sudo apt install ros--canopen # replace with your ROS2 distro diff --git a/canopen/sphinx/quickstart/operation.rst b/canopen/sphinx/quickstart/setup-network.rst similarity index 100% rename from canopen/sphinx/quickstart/operation.rst rename to canopen/sphinx/quickstart/setup-network.rst diff --git a/canopen/sphinx/user-guide/configuration.rst b/canopen/sphinx/user-guide/configuration.rst index 6c17704ab..58858da95 100644 --- a/canopen/sphinx/user-guide/configuration.rst +++ b/canopen/sphinx/user-guide/configuration.rst @@ -9,13 +9,13 @@ Consequently, the structure of the configuration package should look as follows: :: - {package_name} + {package_name} ├── config │ ├── {bus_config_name_1} - │ | ├── bus.yml - │ | ├── {device1}.eds - │ | ├── {device...}.eds - │ | └── {slave_n}.eds + │ │ ├── bus.yml + │ │ ├── {device1}.eds + │ │ ├── {device...}.eds + │ │ └── {slave_n}.eds │ └── {bus_config_name_2} │ ├── bus.yml │ ├── {device1}.eds @@ -23,14 +23,14 @@ Consequently, the structure of the configuration package should look as follows: │ └── {slave_n}.eds ├── launch │ ├── {bus_config_name_1}.launch.py - | └── {bus_config_name_1}.launch.py + │ └── {bus_config_name_1}.launch.py ├── CMakeLists.txt └── package.xml - +See section :doc:`how-to-create-a-configuration` for more details. Bus Configuration File -============================ +----------------------- The ros2_canopen stack relies on a YAML configuration file that is used for configuring the bus topology and specifying configurations for @@ -39,7 +39,7 @@ EDS/DCF file applies to them, which parameters of the EDS/DCF files should be overwritten and which drivers should be used to control the devices. Structure ---------- +'''''''''' The YAML configuration file has the following sections: @@ -63,7 +63,7 @@ The YAML configuration file has the following sections: Options Section ---------------- +'''''''''''''''' The options section holds general options. Right now these are only the following. .. csv-table:: Options Configuration @@ -77,7 +77,7 @@ The options section holds general options. Right now these are only the followin Master Section --------------- +'''''''''''''''' The master section has a number of configuration options. These are not unique to ros2_canopen but come from the lely core library. Below you find a list of possible configuration items. @@ -113,8 +113,8 @@ but come from the lely core library. Below you find a list of possible configura boot_time; The timeout for booting mandatory slaves in ms (default: 0, see object 1F89). boot_timeout; The timeout for booting all slaves in ms (default: 2000ms). -Device Section --------------- +Defaults Section +'''''''''''''''''' The device configuration enables configuring the characteristics of the connected CANopen device. @@ -157,19 +157,11 @@ device. Further references ------------------- +################### The dcfgen documentation gives more details on the usage of the dcfgen tool for generating DCF: https://opensource.lely.com/canopen/docs/dcf-tools/ -Variables ---------- - -``@BUS_CONFIG_PATH@:`` Automatic config path definition if configuration package structure is followed. - - - - Configuration Package CMake -=========================== +--------------------------- In order to build the configuration package and generate the necessary runtime artifacts from the bus configuration file and eds/dcf files, the lely_core_libraries package contains an extra @@ -177,7 +169,7 @@ CMAKE macro. **cogen_dcf(target)** -Target: the name of the configuration (e.g. for config/{bus_config_name_1} is bus_config_name_1) +*Target: the name of the configuration (e.g. for config/{bus_config_name_1} is bus_config_name_1)* .. code-block:: diff --git a/canopen/sphinx/user-guide/operation.rst b/canopen/sphinx/user-guide/operation.rst index b683aa2f0..62f72b313 100644 --- a/canopen/sphinx/user-guide/operation.rst +++ b/canopen/sphinx/user-guide/operation.rst @@ -1,48 +1,59 @@ -Operation -========= - -The ros2_canopen stack can be used in three different ways: - -* standard nodes container -* managed nodes container -* ros2_control system interface with standard nodes - - -Simple nodes container -"""""""""""""""""""""""" -The standard node container mode bundles the master and all slave driver nodes in one specialised -container called device container. All nodes are simple ROS 2 nodes and expose a publish and subscribe -as well as a service interfaces. Once the device container is started, all nodes are brought up -and ready to be used. - -**Purpose**: -The simple nodes container is thought for applications where the user needs a simple and -easy to launch interface and does not need any realtime control capabilities as provided by -ros2_control. - -Managed nodes container -"""""""""""""""""""""""""" -The managed nodes container has the same properties as the standard nodes container. -The exception is, that all nodes are lifecycle nodes and there is a special node called -lifecycle manager. The user can use the lifecycle manager to control the lifecycle of -all nodes in the container. - -**Purpose**: -The managed nodes container is thought for applications where the user wants to have -more runtime recovery options than killing and restarting the container. - - -ROS 2 control system interface -"""""""""""""""""""""""""""""" -The ros2_control interface is currently build on top of the simple nodes container. In -addition to the standard nodes container the ros2_control system interface provides a -hardware interface that can be used to control the devices on the bus. Currently, three -different system interfaces are provided: - -* canopen_ros2_control/CANopenSystem -* canopen_ros2_control/CIA402System -* canopen_ros2_control/RobotSystem - -**Purpose**: -The ROS 2 control system interfaces are thought for control applications that require -low latencies. +Operation of the ROS2 CANopen Stack +=================================== + +The ROS2 CANopen stack provides flexible operation modes tailored to various application requirements. It can be configured in one of the following three ways: + +1. Simple Nodes Container +2. Managed Nodes Container +3. ROS 2 Control System Interface + +Simple Nodes Container +---------------------- +The Simple Nodes Container bundles the master with all slave driver nodes into a specialized container known as the device container. All nodes within +this container are simple ROS 2 nodes, offering publish, subscribe, and service interfaces. Once the device container is launched, all contained nodes +are immediately operational. + +**Purpose**: This container is designed for scenarios requiring a straightforward, easy-to-launch interface without the need for real-time control, +such as those offered by *ros2_control*. + +For more information on configuring and utilizing these interfaces, see :doc:`operation/service-interface`. + +Managed Nodes Container +----------------------- +The Managed Nodes Container operates similarly to the Simple Nodes Container, with the key difference being the use of lifecycle nodes and a dedicated +lifecycle manager. This manager allows for sophisticated control over the lifecycle of all nodes in the container, enhancing fault recovery and system manageability. +For more information on lifecycle nodes, refer to the `ROS 2 Node Lifecycle documentation `_. + +**Purpose**: Ideal for applications demanding enhanced runtime recovery options beyond simple restarts. + +For more information on configuring and utilizing these interfaces, see :doc:`operation/managed-service-interface`. + +ROS 2 Control System Interface +------------------------------ +Built on the foundation of the Simple Nodes Container, the ROS 2 Control System Interface integrates a hardware interface that facilitates direct control +over devices connected on the bus. It supports several system interfaces designed for specific control needs: + +- canopen_ros2_control/CANopenSystem +- canopen_ros2_control/CIA402System +- canopen_ros2_control/RobotSystem + +**Purpose**: These interfaces are suitable for applications requiring precise, low-latency control mechanisms. + +For more information on configuring and utilizing these interfaces, refer to :doc:`operation/ros2-control-interface`. + +Requirements for Setting Up the ROS2 CANopen Stack +-------------------------------------------------- +To start with ROS2 CANOpen Stack, you need to have the following prerequisites: + +To effectively implement and utilize the ROS2 CANopen stack, certain prerequisites must be met. Below is a comprehensive list of these requirements: + +1. **EDS or DCF Files**: You'll need the Electronic Data Sheet (EDS) or Device Configuration File (DCF) for each CANopen device. These files contain +crucial device-specific parameters and configuration details necessary for communication and operational functionality. + +2. **bus.yml File Configuration**: Prepare the `bus.yml` file, which outlines the bus topology and device-specific settings. This configuration file +should specify details such as which devices are connected, the relevant EDS/DCF files, parameter overrides, and driver assignments for each device. + +3. **Network Configuration**: Set up and configure your network to match the requirements of your CANopen devices and the ROS2 CANopen stack. See :doc:`../quickstart/setup-network` + +These are the basic requirements, and continue with the following sections to learn more about the operation modes and how to set up the ROS2 CANopen stack. + diff --git a/canopen/sphinx/user-guide/operation/managed-service-interface.rst b/canopen/sphinx/user-guide/operation/managed-service-interface.rst index e7962b486..7424dc5bc 100644 --- a/canopen/sphinx/user-guide/operation/managed-service-interface.rst +++ b/canopen/sphinx/user-guide/operation/managed-service-interface.rst @@ -1,52 +1,50 @@ Managed Service Interface -============================ +========================= - -Device Container with managed nodes -""""""""""""""""""""""""""""""""""" -The device container implements ROS2 component manager. The load and unload services are disabled. -Devices are loaded based on the Bus Configuration File (bus.yml). The device container provides -the list service, which can be used with ros2cli to check which components have been loaded. +Device Container with Managed Nodes +----------------------------------- +The device container operates as a ROS2 component manager with load and unload services disabled. It utilizes the Bus Configuration File (``bus.yml``) to +load devices. This container also offers a list service, which can be utilized with ros2cli to verify the loaded components. .. figure:: ../../images/device-manager.png :alt: Device Manager Concept - device manager concept + Overview of the device manager concept. -The device container uses the bus description file to identify the correct drivers for each devices. -On launch it will load the CANopen master node and driver nodes and pass the appropriate configuration -data to the nodes. The nodes are now in unconfigured state. +Upon startup, the device container uses the bus description file to identify and load the appropriate drivers for each device, +including the CANopen master node. Initially, the nodes are in an unconfigured state. -When using the default launch files in canopen_core the lifecycle manager node will automatically -be launched. The lifecycle manager takes care of sequencing the lifecycle of the different nodes in the -device container. By bringing the lifecycle_manager to active lifecycle state, all master and driver nodes -will be activated in correct sequence. +The default launch files from the ``canopen_core`` package automatically initiate the lifecycle manager node, which orchestrates +the sequencing and state transitions of all nodes within the container. Activating the lifecycle manager progresses all nodes from an +unconfigured to an active state in a predetermined sequence. -If you choose to write your own lifecycle_manager, you'll need to remember, that the master needs -to be configured and activated before any driver node can be configured or activated. +.. note:: + For custom implementations, it is crucial to configure and activate the master node before setting up any driver nodes to ensure proper system functionality. Bus Configuration -""""""""""""""""" -The bus configuration for the managed service interface needs to use the driver classes that are marked as -lifecycle drivers. The master driver indicates whether the bus.yml will be treated as managed or un-managed -service interface. +----------------- +The bus configuration specific to this interface must incorporate driver classes designated as lifecycle drivers. The master driver within +this setup dictates whether the ``bus.yml`` is considered a managed or an unmanaged service interface. .. csv-table:: Available Driver Components :header: "Package", "Component" - canopen_master_driver, ros2_canopen::LifecycleMasterDriver - canopen_proxy_driver, ros2_canopen::LifecycleProxyDriver - canopen_402_driver, ros2_canopen::LifecycleCia402Driver + canopen_master_driver, ros2_canopen::LifecycleMasterDriver + canopen_proxy_driver, ros2_canopen::LifecycleProxyDriver + canopen_402_driver, ros2_canopen::LifecycleCia402Driver -Launching -""""""""""""" -The device manager has the following configuration parameters. +Launching Parameters +-------------------- +The device manager's operation is guided by several crucial configuration parameters: -.. csv-table:: Parameters +.. csv-table:: Configuration Parameters :header: "Parameter", "Type", "Description" - bus_conf, string, (Mandatory) Path to the bus configuration YAML-file - master_dcf, string, (Mandatory) Path to the DCF file to be used by the master node. Usually generated by dcfgen as master.dcf. - master_bin, string, (Optional) Path to the concise DCF (.bin) file to be used to configure the master. Usually generated by dcfgen as master.bin. (default: "") - can_interface_name, string, (Mandatory) Name of the CAN interface to be used. (default: vcan0) + bus_conf, string, (Mandatory) Path to the bus configuration YAML-file + master_dcf, string, (Mandatory) Path to the DCF file for the master node, typically generated by dcfgen as master.dcf. + master_bin, string, (Optional) Path to the concise DCF (.bin) file for master configuration, typically generated by dcfgen as master.bin. (default: "") + can_interface_name, string, (Mandatory) Name of the CAN interface to be used. (default: "vcan0") + +This section outlines the configuration and management of nodes within the ROS2 CANopen architecture, emphasizing the importance of lifecycle management +for robust device interaction and control. diff --git a/canopen/sphinx/user-guide/operation/ros2-control-interface.rst b/canopen/sphinx/user-guide/operation/ros2-control-interface.rst index 5a9b66bd0..68ea97cc1 100644 --- a/canopen/sphinx/user-guide/operation/ros2-control-interface.rst +++ b/canopen/sphinx/user-guide/operation/ros2-control-interface.rst @@ -4,26 +4,22 @@ This package provides multiple hardware interfaces for testing. Mainly the follo - canopen_ros2_control/CanopenSystem: A system interface for ProxyDrivers - canopen_ros2_control/Cia402System: A system interface for Cia402Drivers -- canopen_ros2_control/Cia402RobotSystem: A system interface for Cia402Drivers in a robot configuration (under development) +- canopen_ros2_control/RobotSystem: A system interface for Cia402Drivers in a robot configuration. Robot System Interface -'''''''''''''''''''''' +---------------------- +The Robot System Interface utilizes information from the robot's URDF (Unified Robot Description Format) to configure and manage Cia402Drivers +via the ros2_control hardware interface. The system configuration is determined by the `bus.yml` file, and each joint's associated CANopen device +is specified using the `node_id`. -The robot system interface takes a number of inputs from the robot description (urdf). -It will make the Cia402Drivers available via the ros2_control hardware interface. -The bus has to still be defined in the bus.yml file. In the urdf you can the choose the -CANopen nodes that have a Cia402Driver attached to them. - -The ros2_control interface only works with non-lifecycle drivers right now. -For each joint in your urdf you can choose the attached CANopen device by using the -``node_id`` parameter. The ``node_id`` parameter is the CANopen node id of the device. +**Configuration Example**: .. code-block:: xml - canopen_ros2_control/Cia402RobotSystem + canopen_ros2_control/RobotSystem [path to bus.yml] [path to master.dcf] [can interface to be used] @@ -34,40 +30,35 @@ For each joint in your urdf you can choose the attached CANopen device by using ... - 3 + 4 ... .. note:: - - You can find an example for the configuration in the ``canopen_tests`` package under robot_control. - + For practical implementation examples, refer to the `canopen_tests` package. ROS2 Controllers ---------------- -This package provides multiple controllers for testing. Mainly the following: - -- canopen_ros2_controllers/Cia402RobotController: Works with Robot System Interface -- canopen_ros2_controllers/Cia402DeviceController: Works with Cia402System -- canopen_ros2_controllers/CanopenProxyController: Works with CanopenSystem and Cia402System +The package provides several controllers optimized for different setups within the ROS2 framework: -Robot Controller -'''''''''''''''' +- **canopen_ros2_controllers/Cia402RobotController**: Integrates seamlessly with the Robot System Interface. +- **canopen_ros2_controllers/Cia402DeviceController**: Compatible with the Cia402System, facilitating device-specific controls. +- **canopen_ros2_controllers/CanopenProxyController**: Works with both CanopenSystem and Cia402System interfaces, providing versatile control options. -The robot controller enables bringing up the different joints of the robot automatically -by using the ros2_controller lifecycle. There is no need for further action, once the -controller is activated, the drives are ready to be used. +Robot Controller Configuration +------------------------------ +The Robot Controller simplifies the operation of robotic joints, automatically managing their states through the ros2_controller lifecycle. +Once activated, the controller ensures that all drives are operational without requiring further user intervention. -The robot controller can be configured in the ros2_controllers.yaml with the following -parameters: +**Configuration Parameters**: .. code-block:: yaml robot_controller: ros__parameters: - joints: # joints that are controlled by the controller - - joint1 - - joint2 - operation_mode: 1 # operation mode of the controller - command_poll_freq: 5 # frequency with which the controller polls for command feedback + joints: # List of joints controlled by the controller + - joint1 + - joint2 + operation_mode: 1 # Operational mode of the controller + command_poll_freq: 5 # Frequency (Hz) at which the controller polls for command feedback \ No newline at end of file From c4e9d1b24d5c71bd89cac985d7bb94a12df18013 Mon Sep 17 00:00:00 2001 From: ipa-vsp Date: Tue, 23 Apr 2024 13:02:28 +0200 Subject: [PATCH 02/10] pre-commit --- canopen/sphinx/user-guide/configuration.rst | 2 +- canopen/sphinx/user-guide/operation.rst | 8 +++----- .../operation/managed-service-interface.rst | 14 +++++++------- .../operation/ros2-control-interface.rst | 12 ++++++------ 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/canopen/sphinx/user-guide/configuration.rst b/canopen/sphinx/user-guide/configuration.rst index 58858da95..9adbaf36b 100644 --- a/canopen/sphinx/user-guide/configuration.rst +++ b/canopen/sphinx/user-guide/configuration.rst @@ -27,7 +27,7 @@ Consequently, the structure of the configuration package should look as follows: ├── CMakeLists.txt └── package.xml -See section :doc:`how-to-create-a-configuration` for more details. +See section :doc:`how-to-create-a-configuration` for more details. Bus Configuration File ----------------------- diff --git a/canopen/sphinx/user-guide/operation.rst b/canopen/sphinx/user-guide/operation.rst index 62f72b313..602c5af99 100644 --- a/canopen/sphinx/user-guide/operation.rst +++ b/canopen/sphinx/user-guide/operation.rst @@ -47,13 +47,11 @@ To start with ROS2 CANOpen Stack, you need to have the following prerequisites: To effectively implement and utilize the ROS2 CANopen stack, certain prerequisites must be met. Below is a comprehensive list of these requirements: -1. **EDS or DCF Files**: You'll need the Electronic Data Sheet (EDS) or Device Configuration File (DCF) for each CANopen device. These files contain -crucial device-specific parameters and configuration details necessary for communication and operational functionality. +1. **EDS or DCF Files**: You'll need the Electronic Data Sheet (EDS) or Device Configuration File (DCF) for each CANopen device. These files contain + crucial device-specific parameters and configuration details necessary for communication and operational functionality. -2. **bus.yml File Configuration**: Prepare the `bus.yml` file, which outlines the bus topology and device-specific settings. This configuration file -should specify details such as which devices are connected, the relevant EDS/DCF files, parameter overrides, and driver assignments for each device. +2. **bus.yml File Configuration**: Prepare the ``bus.yml`` file, which outlines the bus topology and device-specific settings. This configuration file should specify details such as which devices are connected, the relevant EDS/DCF files, parameter overrides, and driver assignments for each device. 3. **Network Configuration**: Set up and configure your network to match the requirements of your CANopen devices and the ROS2 CANopen stack. See :doc:`../quickstart/setup-network` These are the basic requirements, and continue with the following sections to learn more about the operation modes and how to set up the ROS2 CANopen stack. - diff --git a/canopen/sphinx/user-guide/operation/managed-service-interface.rst b/canopen/sphinx/user-guide/operation/managed-service-interface.rst index 7424dc5bc..133a8fdd4 100644 --- a/canopen/sphinx/user-guide/operation/managed-service-interface.rst +++ b/canopen/sphinx/user-guide/operation/managed-service-interface.rst @@ -3,7 +3,7 @@ Managed Service Interface Device Container with Managed Nodes ----------------------------------- -The device container operates as a ROS2 component manager with load and unload services disabled. It utilizes the Bus Configuration File (``bus.yml``) to +The device container operates as a ROS2 component manager with load and unload services disabled. It utilizes the Bus Configuration File (``bus.yml``) to load devices. This container also offers a list service, which can be utilized with ros2cli to verify the loaded components. .. figure:: ../../images/device-manager.png @@ -11,20 +11,20 @@ load devices. This container also offers a list service, which can be utilized w Overview of the device manager concept. -Upon startup, the device container uses the bus description file to identify and load the appropriate drivers for each device, +Upon startup, the device container uses the bus description file to identify and load the appropriate drivers for each device, including the CANopen master node. Initially, the nodes are in an unconfigured state. -The default launch files from the ``canopen_core`` package automatically initiate the lifecycle manager node, which orchestrates -the sequencing and state transitions of all nodes within the container. Activating the lifecycle manager progresses all nodes from an +The default launch files from the ``canopen_core`` package automatically initiate the lifecycle manager node, which orchestrates +the sequencing and state transitions of all nodes within the container. Activating the lifecycle manager progresses all nodes from an unconfigured to an active state in a predetermined sequence. -.. note:: +.. note:: For custom implementations, it is crucial to configure and activate the master node before setting up any driver nodes to ensure proper system functionality. Bus Configuration ----------------- -The bus configuration specific to this interface must incorporate driver classes designated as lifecycle drivers. The master driver within +The bus configuration specific to this interface must incorporate driver classes designated as lifecycle drivers. The master driver within this setup dictates whether the ``bus.yml`` is considered a managed or an unmanaged service interface. .. csv-table:: Available Driver Components @@ -46,5 +46,5 @@ The device manager's operation is guided by several crucial configuration parame master_bin, string, (Optional) Path to the concise DCF (.bin) file for master configuration, typically generated by dcfgen as master.bin. (default: "") can_interface_name, string, (Mandatory) Name of the CAN interface to be used. (default: "vcan0") -This section outlines the configuration and management of nodes within the ROS2 CANopen architecture, emphasizing the importance of lifecycle management +This section outlines the configuration and management of nodes within the ROS2 CANopen architecture, emphasizing the importance of lifecycle management for robust device interaction and control. diff --git a/canopen/sphinx/user-guide/operation/ros2-control-interface.rst b/canopen/sphinx/user-guide/operation/ros2-control-interface.rst index 68ea97cc1..d6583e50d 100644 --- a/canopen/sphinx/user-guide/operation/ros2-control-interface.rst +++ b/canopen/sphinx/user-guide/operation/ros2-control-interface.rst @@ -4,14 +4,14 @@ This package provides multiple hardware interfaces for testing. Mainly the follo - canopen_ros2_control/CanopenSystem: A system interface for ProxyDrivers - canopen_ros2_control/Cia402System: A system interface for Cia402Drivers -- canopen_ros2_control/RobotSystem: A system interface for Cia402Drivers in a robot configuration. +- canopen_ros2_control/RobotSystem: A system interface for Cia402Drivers in a robot configuration. Robot System Interface ---------------------- -The Robot System Interface utilizes information from the robot's URDF (Unified Robot Description Format) to configure and manage Cia402Drivers -via the ros2_control hardware interface. The system configuration is determined by the `bus.yml` file, and each joint's associated CANopen device -is specified using the `node_id`. +The Robot System Interface utilizes information from the robot's URDF (Unified Robot Description Format) to configure +and manage Cia402Drivers via the ros2_control hardware interface. The system configuration is determined by the ``bus.yml`` +file, and each joint's associated CANopen device is specified using the ``node_id``. **Configuration Example**: @@ -48,7 +48,7 @@ The package provides several controllers optimized for different setups within t Robot Controller Configuration ------------------------------ -The Robot Controller simplifies the operation of robotic joints, automatically managing their states through the ros2_controller lifecycle. +The Robot Controller simplifies the operation of robotic joints, automatically managing their states through the ros2_controller lifecycle. Once activated, the controller ensures that all drives are operational without requiring further user intervention. **Configuration Parameters**: @@ -61,4 +61,4 @@ Once activated, the controller ensures that all drives are operational without r - joint1 - joint2 operation_mode: 1 # Operational mode of the controller - command_poll_freq: 5 # Frequency (Hz) at which the controller polls for command feedback \ No newline at end of file + command_poll_freq: 5 # Frequency (Hz) at which the controller polls for command feedback From db3a93d92a73e2a798fae825ac8bc260ca98aa8c Mon Sep 17 00:00:00 2001 From: ipa-vsp Date: Tue, 23 Apr 2024 19:58:04 +0200 Subject: [PATCH 03/10] WIP: service interface examples --- .../examples/service-interface-examples.rst | 66 +++++++++++++++++++ canopen/sphinx/index.rst | 9 ++- canopen_tests/CMakeLists.txt | 2 +- canopen_tests/config/simple/bus.yml | 15 ++--- 4 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 canopen/sphinx/examples/service-interface-examples.rst diff --git a/canopen/sphinx/examples/service-interface-examples.rst b/canopen/sphinx/examples/service-interface-examples.rst new file mode 100644 index 000000000..8afdc4367 --- /dev/null +++ b/canopen/sphinx/examples/service-interface-examples.rst @@ -0,0 +1,66 @@ +Service Interface Examples +========================== + +Before running these examples, ensure that to :ref:`start the vcan0 interface `. +You can find these examples in the ``canopen_test`` package. + +Proxy Driver Examples +--------------------- +A proxy driver provides a simple way to forward CANopen functionalities for a specific device using ROS2 services and messages. For more details on the proxy driver, see :doc:`../user-guide/proxy-driver`. + +Configuring ``bus.yaml`` +~~~~~~~~~~~~~~~~~~~~~~~~ +The configuration for the proxy driver is specified in the ``bus.yaml`` file. Here's an example configuration: + +.. code-block:: yaml + + options: + dcf_path: "@BUS_CONFIG_PATH@" + + master: + node_id: 1 + driver: "ros2_canopen::MasterDriver" + package: "canopen_master_driver" + + defaults: + dcf: "simple.eds" + driver: "ros2_canopen::ProxyDriver" + package: "canopen_proxy_driver" + polling: true + period: 10 + + nodes: + proxy_device_1: + node_id: 2 + proxy_device_2: + node_id: 3 + +For further details about the configuration, refer to :doc:`../user-guide/configuration`. Additionally, add ``cogen_dcf(simple)`` in the *CMakeLists.txt* file to generate the necessary artifacts for the proxy driver. + +Running the Proxy Driver Examples +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +To launch the proxy driver setup, use the following command: + +.. code-block:: bash + + $ ros2 launch canopen_tests proxy_setup.launch.py + +Verify that all services are available by running the ROS2 topic and service list commands. To conduct a test: + +.. code-block:: bash + + $ ros2 topic pub /proxy_device_1/tpdo canopen_interfaces/msg/COData "{ index: 0x4000, subindex: 0, data: 200 }" + +Check the output by running: + +.. code-block:: bash + + $ ros2 topic echo /proxy_device_1/rpdo + +.. note:: + + These examples use a fake slave device. Running on actual hardware may yield different results. + Always refer to the device's documentation for specific details. + +CiA402 Driver Examples +----------------------- \ No newline at end of file diff --git a/canopen/sphinx/index.rst b/canopen/sphinx/index.rst index 178fca322..7aed11721 100644 --- a/canopen/sphinx/index.rst +++ b/canopen/sphinx/index.rst @@ -26,6 +26,13 @@ This is the documentation of the ROS2 CANopen stack. user-guide/how-to-create-a-cia301-system user-guide/how-to-create-a-robot-system +.. toctree:: + :maxdepth: 1 + :caption: Examples + :glob: + + examples/service-interface-examples + .. toctree:: :maxdepth: 1 @@ -37,7 +44,7 @@ This is the documentation of the ROS2 CANopen stack. developers-guide/architecture developers-guide/new-driver developers-guide/new-master - API Reference + API Reference .. toctree:: :maxdepth: 1 diff --git a/canopen_tests/CMakeLists.txt b/canopen_tests/CMakeLists.txt index f2f7c052a..8374bf3d9 100644 --- a/canopen_tests/CMakeLists.txt +++ b/canopen_tests/CMakeLists.txt @@ -10,7 +10,7 @@ find_package(ament_cmake REQUIRED) find_package(lely_core_libraries REQUIRED) -generate_dcf(simple) +cogen_dcf(simple) generate_dcf(canopen_system) cogen_dcf(cia402_system) cogen_dcf(cia402_namespaced_system) diff --git a/canopen_tests/config/simple/bus.yml b/canopen_tests/config/simple/bus.yml index 8b26d4e88..cc8bc0ae1 100644 --- a/canopen_tests/config/simple/bus.yml +++ b/canopen_tests/config/simple/bus.yml @@ -6,18 +6,15 @@ master: driver: "ros2_canopen::MasterDriver" package: "canopen_master_driver" -proxy_device_1: - node_id: 2 +defaults: dcf: "simple.eds" driver: "ros2_canopen::ProxyDriver" package: "canopen_proxy_driver" polling: true period: 10 -proxy_device_2: - node_id: 3 - dcf: "simple.eds" - driver: "ros2_canopen::ProxyDriver" - package: "canopen_proxy_driver" - polling: true - period: 10 +nodes: + proxy_device_1: + node_id: 2 + proxy_device_2: + node_id: 3 From d8cc8bfca9e428360c83f7e24debc5f013e4e13a Mon Sep 17 00:00:00 2001 From: Vaidya-Dhruval Date: Thu, 8 Aug 2024 14:50:02 +0200 Subject: [PATCH 04/10] cd '/home/adm-vsp-dv/canopen_docs/ros2_canopen_dv-1' --- canopen/sphinx/application/diff_drive.rst | 2 ++ canopen/sphinx/application/trinamic.rst | 13 ++++++++----- canopen/sphinx/quickstart/installation.rst | 14 ++++++++++---- canopen/sphinx/quickstart/setup-network.rst | 7 +++++++ 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 canopen/sphinx/application/diff_drive.rst diff --git a/canopen/sphinx/application/diff_drive.rst b/canopen/sphinx/application/diff_drive.rst new file mode 100644 index 000000000..65ffd5a5c --- /dev/null +++ b/canopen/sphinx/application/diff_drive.rst @@ -0,0 +1,2 @@ +Differntial Drive Controller +============================ \ No newline at end of file diff --git a/canopen/sphinx/application/trinamic.rst b/canopen/sphinx/application/trinamic.rst index a4330c93f..5c32840ec 100644 --- a/canopen/sphinx/application/trinamic.rst +++ b/canopen/sphinx/application/trinamic.rst @@ -11,11 +11,14 @@ Getting started If you haven't already done so, follow the steps in the :doc:`../user-guide/configuration`. +To know more about how to create a configuration follow this steps: :doc:`../user-guide/how-to-create-a-configuration`. + Configuration ------------- - +- Create new package named ``trinamic_pd42_can``. To know how to create a package follow the documentaion provided in `ROS2 `_ +- Follow the configuration folder tree steps. - Create a new folder in the ``config`` folder of your configuration package. Name it ``single-pd42``. -- Download ``.eds`` file from `Trinamic `_ and place ``TMCM-1270.eds`` in the ``single-pd42`` folder. +- Download ``.eds`` file from `Trinamic `_ and place ``TMCM-1270.eds`` in the ``single-pd42`` folder. (Aparently can also be found int the github link given at the end of this page.) - Create a ``bus.yml`` file in the ``single-pd42`` folder with the following content: .. code-block:: yaml @@ -50,7 +53,7 @@ Configuration node_id: 1 -- Edit the ``CMakeLists.txt`` file in the ``config`` folder of your configuration package and add the following lines: +- Edit the ``CMakeLists.txt`` file in the package and add the following lines: .. code-block:: cmake @@ -93,7 +96,7 @@ Configuration ament_package() -- Create launch file in folder ``launch`` and add the following content: +- Create launch file ``file_name.launch.py`` in folder ``launch`` and add the following content: .. code-block:: python @@ -168,7 +171,7 @@ Configuration Running the example ------------------- -To begin, follow the instructions for :doc:`../quickstart/operation`, which can be done using either a virtual or peak CAN interface. +To begin, follow the instructions for :doc:`../quickstart/setup-network`, which can be done using either a virtual or peak CAN interface. If you prefer to use a real CAN interface, you will need to modify the launch file by changing the ``can_interface_name`` argument to ``can0``. Additionally, if you are using real hardware, you should comment out the fake slave launch by adding a *#* in front of the line *ld.add_action(slave_node_1)*. diff --git a/canopen/sphinx/quickstart/installation.rst b/canopen/sphinx/quickstart/installation.rst index 272af3a23..e239f5ccb 100644 --- a/canopen/sphinx/quickstart/installation.rst +++ b/canopen/sphinx/quickstart/installation.rst @@ -1,20 +1,26 @@ Installation =============================== -Clone ros2_canopen into your ROS2 workspace's source folder, install dependencies and -build with colcon and your done. +- Clone ros2_canopen into your ROS2 workspace's source folder, install dependencies and build with colcon and your done. +- In order to create a workspace .. code-block:: console + $ mkdir -p name_ws/src + $ cd name_ws/src + $ git clone https://github.com/ros-industrial/ros2_canopen.git $ cd .. $ rosdep install --from-paths src/ros2_canopen --ignore-src -r -y $ colcon build + $ source install/setup.bash + +.. note:: + Kindly check the branch before cloning the repository. Testing with pre-release binaries --------------------------------- To test the package with pre-release binaries, you must first set up your ROS2 workspace to use the ROS2 pre-release repositories. -To do this, follow the instructions [here](https://docs.ros.org/en/rolling/Installation/Testing.html#debian-testing-repository). - +To do this, follow the instructions `here` . After that, you can install the packages using the following command, .. code-block:: console diff --git a/canopen/sphinx/quickstart/setup-network.rst b/canopen/sphinx/quickstart/setup-network.rst index 9229fbf96..077b8bf9a 100644 --- a/canopen/sphinx/quickstart/setup-network.rst +++ b/canopen/sphinx/quickstart/setup-network.rst @@ -11,6 +11,13 @@ Setup CAN Controller $ sudo ip link set vcan0 txqueuelen 1000 $ sudo ip link set up vcan0 +To interect with the CAN controller you can use ``can-utils`` in order to know the output of the controller. + +.. code-block:: console + + $ sudo apt install can-utils + $ candump + **Option 2**: Peak CANController .. code-block:: console From 59626d4f5fe613425637e0db9a2a9f0b6c4cbfe0 Mon Sep 17 00:00:00 2001 From: Vaidya-Dhruval Date: Thu, 15 Aug 2024 12:49:36 +0200 Subject: [PATCH 05/10] changed the trinamic eds link --- canopen/sphinx/application/trinamic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canopen/sphinx/application/trinamic.rst b/canopen/sphinx/application/trinamic.rst index 5c32840ec..f9fc9e9a2 100644 --- a/canopen/sphinx/application/trinamic.rst +++ b/canopen/sphinx/application/trinamic.rst @@ -18,7 +18,7 @@ Configuration - Create new package named ``trinamic_pd42_can``. To know how to create a package follow the documentaion provided in `ROS2 `_ - Follow the configuration folder tree steps. - Create a new folder in the ``config`` folder of your configuration package. Name it ``single-pd42``. -- Download ``.eds`` file from `Trinamic `_ and place ``TMCM-1270.eds`` in the ``single-pd42`` folder. (Aparently can also be found int the github link given at the end of this page.) +- Download ``.eds`` file from `Trinamic Github `_ and place ``TMCM-1270.eds`` in the ``single-pd42`` folder. - Create a ``bus.yml`` file in the ``single-pd42`` folder with the following content: .. code-block:: yaml From a62927ae2c2b0c3913f3b5e18cac091d0a4dc5f0 Mon Sep 17 00:00:00 2001 From: Vaidya-Dhruval Date: Thu, 15 Aug 2024 13:48:15 +0200 Subject: [PATCH 06/10] Updated trinamic documentation . Added cpp file .solved pathing issues .changes the link for the .eds file --- canopen/sphinx/application/trinamic.rst | 88 ++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/canopen/sphinx/application/trinamic.rst b/canopen/sphinx/application/trinamic.rst index f9fc9e9a2..75917559a 100644 --- a/canopen/sphinx/application/trinamic.rst +++ b/canopen/sphinx/application/trinamic.rst @@ -16,7 +16,7 @@ To know more about how to create a configuration follow this steps: :doc:`../use Configuration ------------- - Create new package named ``trinamic_pd42_can``. To know how to create a package follow the documentaion provided in `ROS2 `_ -- Follow the configuration folder tree steps. +- Follow the configuration folder tree steps as per the :doc:`../user-guide/configuration`. . - Create a new folder in the ``config`` folder of your configuration package. Name it ``single-pd42``. - Download ``.eds`` file from `Trinamic Github `_ and place ``TMCM-1270.eds`` in the ``single-pd42`` folder. - Create a ``bus.yml`` file in the ``single-pd42`` folder with the following content: @@ -96,7 +96,91 @@ Configuration ament_package() -- Create launch file ``file_name.launch.py`` in folder ``launch`` and add the following content: +- Create a source file in the ``src`` folder ``position_tick_motor.cpp`` and add the follow lines. + + .. code-block:: cpp + + + #include + #include + #include + + #include "canopen_interfaces/srv/co_target_double.hpp" + #include "rclcpp/rclcpp.hpp" + #include "std_srvs/srv/trigger.hpp" + int main(int argc, char * argv[]) + { + rclcpp::init(argc, argv); + + std::shared_ptr node = rclcpp::Node::make_shared("position_tick_motor_node"); + + RCLCPP_INFO(node->get_logger(), "Position Tick Motor Node Started"); + rclcpp::Client::SharedPtr init_client = + node->create_client("/trinamic_pd42/init"); + rclcpp::Client::SharedPtr mode_client = + node->create_client("/trinamic_pd42/cyclic_position_mode"); + rclcpp::Client::SharedPtr target_client = + node->create_client("/trinamic_pd42/target"); + + while (!init_client->wait_for_service(std::chrono::seconds(1)) && + !mode_client->wait_for_service(std::chrono::seconds(1)) && + !target_client->wait_for_service(std::chrono::seconds(1))) + { + if (!rclcpp::ok()) + { + RCLCPP_ERROR(node->get_logger(), "Interrupted while waiting for the service. Exiting."); + return 0; + } + RCLCPP_INFO(node->get_logger(), "service not available, waiting again..."); + } + + auto trigger_req = std::make_shared(); + auto result = init_client->async_send_request(trigger_req); + if (rclcpp::spin_until_future_complete(node, result) == rclcpp::FutureReturnCode::SUCCESS) + { + RCLCPP_INFO(node->get_logger(), "Init service called successfully"); + } + else + { + RCLCPP_ERROR(node->get_logger(), "Failed to call init service"); + } + + result = mode_client->async_send_request(trigger_req); + if (rclcpp::spin_until_future_complete(node, result) == rclcpp::FutureReturnCode::SUCCESS) + { + RCLCPP_INFO(node->get_logger(), "Config position mode service called successfully"); + } + else + { + RCLCPP_ERROR(node->get_logger(), "Failed to call config service"); + } + + RCLCPP_INFO(node->get_logger(), "Starting to send target values"); + + auto targer_req = std::make_shared(); + double target = 0; + while (rclcpp::ok()) + { + targer_req->target = target; + auto res = target_client->async_send_request(targer_req); + if (rclcpp::spin_until_future_complete(node, res) == rclcpp::FutureReturnCode::SUCCESS) + { + RCLCPP_INFO(node->get_logger(), "Set Target: %.2f", target); + } + else + { + RCLCPP_ERROR(node->get_logger(), "Failed to call target service"); + } + rclcpp::sleep_for(std::chrono::seconds(1)); + + target += 1.0; + if (target >= 105.0) target = 0; + } + + return 0; + } + +- Create a launch file ``file_name.launch.py`` in folder ``launch`` and add the following content: .. code-block:: python From 39123b78fa412d366e2bbc6071b33cf660466996 Mon Sep 17 00:00:00 2001 From: Vaidya-Dhruval Date: Thu, 15 Aug 2024 13:49:51 +0200 Subject: [PATCH 07/10] Made basic changes for workspace creation -branch information notice -sourcing the ws --- canopen/sphinx/quickstart/installation.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/canopen/sphinx/quickstart/installation.rst b/canopen/sphinx/quickstart/installation.rst index e239f5ccb..d409815b7 100644 --- a/canopen/sphinx/quickstart/installation.rst +++ b/canopen/sphinx/quickstart/installation.rst @@ -5,25 +5,32 @@ Installation .. code-block:: console - $ mkdir -p name_ws/src - $ cd name_ws/src + $ mkdir -p ~/name_ws/src + $ cd ~/name_ws/src + +.. note:: + Change the ``name_ws`` to your desired workspace name. + +.. code-block:: console $ git clone https://github.com/ros-industrial/ros2_canopen.git $ cd .. + $ source /opt/ros/ros_distro/setup.bash # Replace the *ros distro as per your need. $ rosdep install --from-paths src/ros2_canopen --ignore-src -r -y $ colcon build $ source install/setup.bash .. note:: - Kindly check the branch before cloning the repository. + Kindly check the branch as per your configuration before cloning the repository. Testing with pre-release binaries --------------------------------- To test the package with pre-release binaries, you must first set up your ROS2 workspace to use the ROS2 pre-release repositories. -To do this, follow the instructions `here` . +To do this, follow the instructions +`here `_ . After that, you can install the packages using the following command, .. code-block:: console $ sudo apt update - $ sudo apt install ros--canopen # replace with your ROS2 distro + $ sudo apt install ros--canopen # Replace with your ROS2 distro From febe779202318f005d681911d6a7096146af59e7 Mon Sep 17 00:00:00 2001 From: Vaidya-Dhruval Date: Thu, 15 Aug 2024 13:53:10 +0200 Subject: [PATCH 08/10] added information on can-utils --- canopen/sphinx/quickstart/setup-network.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/canopen/sphinx/quickstart/setup-network.rst b/canopen/sphinx/quickstart/setup-network.rst index 077b8bf9a..5f7c9964a 100644 --- a/canopen/sphinx/quickstart/setup-network.rst +++ b/canopen/sphinx/quickstart/setup-network.rst @@ -2,6 +2,16 @@ Setup CAN Controller ==================== .. _quick-start-setup-can-controller: +To interect with the CAN controller you can use ``can-utils`` in order to know the output of the controller. + +.. code-block:: console + + $ sudo apt install can-utils + $ candump + +.. note:: + This step is only required in order to know the output of the controller. One can skip this step to proceed with the setup of the controller. + **Option 1**: Virtual CANController .. code-block:: console @@ -11,13 +21,7 @@ Setup CAN Controller $ sudo ip link set vcan0 txqueuelen 1000 $ sudo ip link set up vcan0 -To interect with the CAN controller you can use ``can-utils`` in order to know the output of the controller. - -.. code-block:: console - $ sudo apt install can-utils - $ candump - **Option 2**: Peak CANController .. code-block:: console From 9bafefb618be7fcb60914672542d01765af28f5d Mon Sep 17 00:00:00 2001 From: Vaidya-Dhruval Date: Thu, 15 Aug 2024 13:53:53 +0200 Subject: [PATCH 09/10] Solved basic pathing issues in user guide and developwe guide --- canopen/sphinx/index.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/canopen/sphinx/index.rst b/canopen/sphinx/index.rst index 7aed11721..fc8058085 100644 --- a/canopen/sphinx/index.rst +++ b/canopen/sphinx/index.rst @@ -18,6 +18,9 @@ This is the documentation of the ROS2 CANopen stack. :glob: user-guide/operation + user-guide/operation/service-interface + user-guide/operation/ros2-control-interface + user-guide/operation/managed-service-interface user-guide/configuration user-guide/master user-guide/proxy-driver @@ -44,6 +47,7 @@ This is the documentation of the ROS2 CANopen stack. developers-guide/architecture developers-guide/new-driver developers-guide/new-master + developers-guide/new-device-manager API Reference .. toctree:: @@ -58,4 +62,4 @@ This is the documentation of the ROS2 CANopen stack. :caption: Application Demos :glob: - application/** + application/** \ No newline at end of file From 57d5b52b3d28471590fca9925bda4a791d51fdd0 Mon Sep 17 00:00:00 2001 From: ipa-vsp Date: Mon, 18 Nov 2024 13:58:35 +0100 Subject: [PATCH 10/10] restructure user guide --- canopen/sphinx/application/diff_drive.rst | 4 ++-- canopen/sphinx/application/trinamic.rst | 2 +- .../examples/service-interface-examples.rst | 8 ++++---- canopen/sphinx/index.rst | 17 +++++------------ canopen/sphinx/quickstart/installation.rst | 8 ++++---- canopen/sphinx/quickstart/setup-network.rst | 6 +++--- canopen/sphinx/user-guide/1_operation.rst | 10 ++++++++++ canopen/sphinx/user-guide/2_interface.rst | 15 +++++++++++++++ canopen/sphinx/user-guide/3_configuration.rst | 11 +++++++++++ .../3_configuration/1_bus_configuration.rst | 2 ++ canopen/sphinx/user-guide/4_how_to_guide.rst | 2 ++ .../user-guide/{ => _old}/cia402-driver.rst | 0 .../user-guide/{ => _old}/configuration.rst | 0 .../how-to-create-a-cia301-system.rst | 0 .../how-to-create-a-configuration.rst | 0 .../{ => _old}/how-to-create-a-robot-system.rst | 0 canopen/sphinx/user-guide/{ => _old}/master.rst | 0 .../sphinx/user-guide/{ => _old}/operation.rst | 0 .../operation/managed-service-interface.rst | 0 .../operation/ros2-control-interface.rst | 0 .../{ => _old}/operation/service-interface.rst | 0 .../user-guide/{ => _old}/proxy-driver.rst | 0 22 files changed, 59 insertions(+), 26 deletions(-) create mode 100644 canopen/sphinx/user-guide/1_operation.rst create mode 100644 canopen/sphinx/user-guide/2_interface.rst create mode 100644 canopen/sphinx/user-guide/3_configuration.rst create mode 100644 canopen/sphinx/user-guide/3_configuration/1_bus_configuration.rst create mode 100644 canopen/sphinx/user-guide/4_how_to_guide.rst rename canopen/sphinx/user-guide/{ => _old}/cia402-driver.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/configuration.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/how-to-create-a-cia301-system.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/how-to-create-a-configuration.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/how-to-create-a-robot-system.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/master.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/operation.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/operation/managed-service-interface.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/operation/ros2-control-interface.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/operation/service-interface.rst (100%) rename canopen/sphinx/user-guide/{ => _old}/proxy-driver.rst (100%) diff --git a/canopen/sphinx/application/diff_drive.rst b/canopen/sphinx/application/diff_drive.rst index 65ffd5a5c..52a7fd314 100644 --- a/canopen/sphinx/application/diff_drive.rst +++ b/canopen/sphinx/application/diff_drive.rst @@ -1,2 +1,2 @@ -Differntial Drive Controller -============================ \ No newline at end of file +Differential Drive Controller +============================= diff --git a/canopen/sphinx/application/trinamic.rst b/canopen/sphinx/application/trinamic.rst index 75917559a..a289774b2 100644 --- a/canopen/sphinx/application/trinamic.rst +++ b/canopen/sphinx/application/trinamic.rst @@ -15,7 +15,7 @@ To know more about how to create a configuration follow this steps: :doc:`../use Configuration ------------- -- Create new package named ``trinamic_pd42_can``. To know how to create a package follow the documentaion provided in `ROS2 `_ +- Create new package named ``trinamic_pd42_can``. To know how to create a package follow the documentation provided in `ROS2 `_ - Follow the configuration folder tree steps as per the :doc:`../user-guide/configuration`. . - Create a new folder in the ``config`` folder of your configuration package. Name it ``single-pd42``. - Download ``.eds`` file from `Trinamic Github `_ and place ``TMCM-1270.eds`` in the ``single-pd42`` folder. diff --git a/canopen/sphinx/examples/service-interface-examples.rst b/canopen/sphinx/examples/service-interface-examples.rst index 8afdc4367..c00604d49 100644 --- a/canopen/sphinx/examples/service-interface-examples.rst +++ b/canopen/sphinx/examples/service-interface-examples.rst @@ -1,7 +1,7 @@ Service Interface Examples ========================== -Before running these examples, ensure that to :ref:`start the vcan0 interface `. +Before running these examples, ensure that to :ref:`start the vcan0 interface `. You can find these examples in the ``canopen_test`` package. Proxy Driver Examples @@ -13,7 +13,7 @@ Configuring ``bus.yaml`` The configuration for the proxy driver is specified in the ``bus.yaml`` file. Here's an example configuration: .. code-block:: yaml - + options: dcf_path: "@BUS_CONFIG_PATH@" @@ -59,8 +59,8 @@ Check the output by running: .. note:: - These examples use a fake slave device. Running on actual hardware may yield different results. + These examples use a fake slave device. Running on actual hardware may yield different results. Always refer to the device's documentation for specific details. CiA402 Driver Examples ------------------------ \ No newline at end of file +----------------------- diff --git a/canopen/sphinx/index.rst b/canopen/sphinx/index.rst index fc8058085..25a579a3d 100644 --- a/canopen/sphinx/index.rst +++ b/canopen/sphinx/index.rst @@ -17,17 +17,10 @@ This is the documentation of the ROS2 CANopen stack. :caption: User Guide :glob: - user-guide/operation - user-guide/operation/service-interface - user-guide/operation/ros2-control-interface - user-guide/operation/managed-service-interface - user-guide/configuration - user-guide/master - user-guide/proxy-driver - user-guide/cia402-driver - user-guide/how-to-create-a-configuration - user-guide/how-to-create-a-cia301-system - user-guide/how-to-create-a-robot-system + user-guide/1_operation + user-guide/2_interface + user-guide/3_configuration + user-guide/4_how_to_guide .. toctree:: :maxdepth: 1 @@ -62,4 +55,4 @@ This is the documentation of the ROS2 CANopen stack. :caption: Application Demos :glob: - application/** \ No newline at end of file + application/** diff --git a/canopen/sphinx/quickstart/installation.rst b/canopen/sphinx/quickstart/installation.rst index d409815b7..589a112ee 100644 --- a/canopen/sphinx/quickstart/installation.rst +++ b/canopen/sphinx/quickstart/installation.rst @@ -8,7 +8,7 @@ Installation $ mkdir -p ~/name_ws/src $ cd ~/name_ws/src -.. note:: +.. note:: Change the ``name_ws`` to your desired workspace name. .. code-block:: console @@ -18,15 +18,15 @@ Installation $ source /opt/ros/ros_distro/setup.bash # Replace the *ros distro as per your need. $ rosdep install --from-paths src/ros2_canopen --ignore-src -r -y $ colcon build - $ source install/setup.bash + $ source install/setup.bash -.. note:: +.. note:: Kindly check the branch as per your configuration before cloning the repository. Testing with pre-release binaries --------------------------------- To test the package with pre-release binaries, you must first set up your ROS2 workspace to use the ROS2 pre-release repositories. -To do this, follow the instructions +To do this, follow the instructions `here `_ . After that, you can install the packages using the following command, diff --git a/canopen/sphinx/quickstart/setup-network.rst b/canopen/sphinx/quickstart/setup-network.rst index 5f7c9964a..d3ff5aa0e 100644 --- a/canopen/sphinx/quickstart/setup-network.rst +++ b/canopen/sphinx/quickstart/setup-network.rst @@ -2,14 +2,14 @@ Setup CAN Controller ==================== .. _quick-start-setup-can-controller: -To interect with the CAN controller you can use ``can-utils`` in order to know the output of the controller. +To interact with the CAN controller you can use ``can-utils`` in order to know the output of the controller. .. code-block:: console $ sudo apt install can-utils $ candump - -.. note:: + +.. note:: This step is only required in order to know the output of the controller. One can skip this step to proceed with the setup of the controller. **Option 1**: Virtual CANController diff --git a/canopen/sphinx/user-guide/1_operation.rst b/canopen/sphinx/user-guide/1_operation.rst new file mode 100644 index 000000000..573a471ea --- /dev/null +++ b/canopen/sphinx/user-guide/1_operation.rst @@ -0,0 +1,10 @@ +Operations +========== + +.. toctree:: + :maxdepth: 1 + :caption: Operation + :glob: + + 1_operation/1_operation_modes + 1_operation/2_operation_interface diff --git a/canopen/sphinx/user-guide/2_interface.rst b/canopen/sphinx/user-guide/2_interface.rst new file mode 100644 index 000000000..8c2269162 --- /dev/null +++ b/canopen/sphinx/user-guide/2_interface.rst @@ -0,0 +1,15 @@ +Interfaces +========== + + +.. toctree:: + :maxdepth: 1 + :caption: Configuration + :glob: + + 2_interface/1_interface_overview + 2_interface/2_master_interface + 2_interface/3_proxy_interface + 2_interface/4_cia402_interface + 2_interface/5_ros2_control_interface + 2_interface/6_ros2_controllers diff --git a/canopen/sphinx/user-guide/3_configuration.rst b/canopen/sphinx/user-guide/3_configuration.rst new file mode 100644 index 000000000..334a0ef47 --- /dev/null +++ b/canopen/sphinx/user-guide/3_configuration.rst @@ -0,0 +1,11 @@ +Configuration +============== + +.. toctree:: + :maxdepth: 1 + :caption: Configuration + :glob: + + 3_configuration/1_bus_configuration + 3_configuration/2_cmake_configuration + 3_configuration/3_device_configuration diff --git a/canopen/sphinx/user-guide/3_configuration/1_bus_configuration.rst b/canopen/sphinx/user-guide/3_configuration/1_bus_configuration.rst new file mode 100644 index 000000000..9c160a909 --- /dev/null +++ b/canopen/sphinx/user-guide/3_configuration/1_bus_configuration.rst @@ -0,0 +1,2 @@ +Bus Configuration +================= diff --git a/canopen/sphinx/user-guide/4_how_to_guide.rst b/canopen/sphinx/user-guide/4_how_to_guide.rst new file mode 100644 index 000000000..9c79b573a --- /dev/null +++ b/canopen/sphinx/user-guide/4_how_to_guide.rst @@ -0,0 +1,2 @@ +How to create your own CANopen Package +====================================== diff --git a/canopen/sphinx/user-guide/cia402-driver.rst b/canopen/sphinx/user-guide/_old/cia402-driver.rst similarity index 100% rename from canopen/sphinx/user-guide/cia402-driver.rst rename to canopen/sphinx/user-guide/_old/cia402-driver.rst diff --git a/canopen/sphinx/user-guide/configuration.rst b/canopen/sphinx/user-guide/_old/configuration.rst similarity index 100% rename from canopen/sphinx/user-guide/configuration.rst rename to canopen/sphinx/user-guide/_old/configuration.rst diff --git a/canopen/sphinx/user-guide/how-to-create-a-cia301-system.rst b/canopen/sphinx/user-guide/_old/how-to-create-a-cia301-system.rst similarity index 100% rename from canopen/sphinx/user-guide/how-to-create-a-cia301-system.rst rename to canopen/sphinx/user-guide/_old/how-to-create-a-cia301-system.rst diff --git a/canopen/sphinx/user-guide/how-to-create-a-configuration.rst b/canopen/sphinx/user-guide/_old/how-to-create-a-configuration.rst similarity index 100% rename from canopen/sphinx/user-guide/how-to-create-a-configuration.rst rename to canopen/sphinx/user-guide/_old/how-to-create-a-configuration.rst diff --git a/canopen/sphinx/user-guide/how-to-create-a-robot-system.rst b/canopen/sphinx/user-guide/_old/how-to-create-a-robot-system.rst similarity index 100% rename from canopen/sphinx/user-guide/how-to-create-a-robot-system.rst rename to canopen/sphinx/user-guide/_old/how-to-create-a-robot-system.rst diff --git a/canopen/sphinx/user-guide/master.rst b/canopen/sphinx/user-guide/_old/master.rst similarity index 100% rename from canopen/sphinx/user-guide/master.rst rename to canopen/sphinx/user-guide/_old/master.rst diff --git a/canopen/sphinx/user-guide/operation.rst b/canopen/sphinx/user-guide/_old/operation.rst similarity index 100% rename from canopen/sphinx/user-guide/operation.rst rename to canopen/sphinx/user-guide/_old/operation.rst diff --git a/canopen/sphinx/user-guide/operation/managed-service-interface.rst b/canopen/sphinx/user-guide/_old/operation/managed-service-interface.rst similarity index 100% rename from canopen/sphinx/user-guide/operation/managed-service-interface.rst rename to canopen/sphinx/user-guide/_old/operation/managed-service-interface.rst diff --git a/canopen/sphinx/user-guide/operation/ros2-control-interface.rst b/canopen/sphinx/user-guide/_old/operation/ros2-control-interface.rst similarity index 100% rename from canopen/sphinx/user-guide/operation/ros2-control-interface.rst rename to canopen/sphinx/user-guide/_old/operation/ros2-control-interface.rst diff --git a/canopen/sphinx/user-guide/operation/service-interface.rst b/canopen/sphinx/user-guide/_old/operation/service-interface.rst similarity index 100% rename from canopen/sphinx/user-guide/operation/service-interface.rst rename to canopen/sphinx/user-guide/_old/operation/service-interface.rst diff --git a/canopen/sphinx/user-guide/proxy-driver.rst b/canopen/sphinx/user-guide/_old/proxy-driver.rst similarity index 100% rename from canopen/sphinx/user-guide/proxy-driver.rst rename to canopen/sphinx/user-guide/_old/proxy-driver.rst