![]() |
remote_modbus package from modbus reporemote_modbus |
Package Summary
Tags | No category tags. |
Version | 0.0.1 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/openvmp/modbus.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-01-06 |
Dev Status | UNMAINTAINED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Roman Kuzmenko
Authors
ROS2 Modbus
This package is an ultimate C++ implementation of Modbus for ROS2.
Most server use cases require Modbus RTU or Modbus TCP instead. However sometimes the servers use this library to simulate the devices or to expose a non-Modbus device using a Modbus interface.
ROS2 clients use this library to communicate with other ROS2 nodes in a way that is abstracted away from the particular method (RTU or TCP).
Architecture
The below diagram explains how the modbus library fits into the overall ROS2 architecture both on the client and server sides. See the following sections for more details.
flowchart TB
cli_serial["# Modbus debugging\n$ ros2 topic echo /modbus/example_bus"] .-> topic_modbus[/ROS2 interfaces:\n/modbus/example_bus/.../]
subgraph modbus["Library: remote_modbus"]
topic_modbus
end
users["Client's\nconsumers"]
subgraph your_exe["Client process"]
config["Register layout\nin YAML"]
subgraph modbus_client_svcs["Services: .../modbus/..."]
generated_services["Register-specific\nservices generated"]
generated_services --> topic_modbus
end
code_dds["Client code\nthat consumes\ntype definitions"]
code_api["Client code\nthat consumes\nnative API"]
code_dds --> topic_modbus
subgraph modbus_client_lib["Library: remote_modbus"]
generate["Generate\nregister\nmappings"]
modbus_topics["ROS2 interface declarations"]
modbus_client["Modbus client API"]
modbus_topics -.- modbus_client
end
config ---> generate
modbus_topics ---> code_dds
code_api ---> modbus_client
end
users --> generated_services
generate --> generated_services
modbus_client --> topic_modbus
subgraph modbus_exe["Server process"]
modbus_server["Modbus server API"]
subgraph modbus
topic_modbus --> modbus_server
end
modbus_server <--> server["Server code"]
end
server .-> device{{"External devices"}}
style device stroke-dasharray: 3 3
Modbus clients
The client may consume ROS type definitions and send the messages directly to the Modbus service providers using ROS communications.
Alternatively, the client may consume a native API which can send simple messages.
Modbus servers
The servers use the modbus library to instantiate ROS2 topics for communication with clients.
This interface is used by Modbus RTU and Modbus TCP libraries. But it can be used to implement alternative access to hardware interfaces that the clients are expecting to access using Modbus.
ROS2 interface
Topics:
- /modbus/<bus-name>/status/
- leafs_seen
- last_leaf
- last_seen
- /modbus/<bus-name>/<leaf-id>/
- last_seen
- last_function_code
- last_error_code
Services:
- /modbus/<bus-name>/<leaf-id>/
- holding_register_read
- holding_register_write (not yet)
- holding_register_write_multiple (not yet)
Native interface
The native interface duplicates the ROS2 service interfaces. The same request and response data types are reused.
Known Limitations
- As of now, the only supported object type is ‘Holding register’
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_cmake | |
rosidl_default_generators | |
rosidl_default_runtime | |
ament_lint_auto | |
ament_lint_common | |
rclcpp | |
std_msgs | |
action_msgs |
System Dependencies
Dependant Packages
Name | Deps |
---|---|
remote_modbus_rtu | |
openvmp_hardware_manager |