Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Designing a System that Exposes Multiple CAN Devices to ROS while Interfacing with Master Device via Serial in Hardware #1956

Open
kyleoptimotive opened this issue Dec 17, 2024 · 1 comment

Comments

@kyleoptimotive
Copy link

Is your feature request related to a problem? Please describe.
I'm looking for input towards the best practices for accomplishing what I've described above. I've confirmed that I can 1. expose one device to ROS and 2. Talk to every device that is connected to the first device via CAN bus. Now I am seeking to expose all devices to ROS while being limited to one serial connection.

Describe the solution you'd like
On a high level, I would like each of the devices exposed to ROS so that they can be run by different controllers without needing to create new code/systems for each one (for example Ackermann, velocity/position, differential).

Hardware Configuration:
(host system) <---serial---> (device_0) <---CAN---> (device_1, ..., device_n)

Desired Behaviour in ROS:
(host system) <-> (device_0, device_1, ... device_n)

Describe alternatives you've considered
These are the ideas/options I have so far and I would appreciate insight.

  1. Create virtual hardware interfaces through a Node that has the ability to communicate to all CAN devices.
  • This node would publish/subscribe to topics that correspond to the hardware devices and would manage the mapping between those topics and communicating over serial/CAN.
  • For example: Lets say we want to set the velocity of a device with CAN ID 1 dev_1 and we are serially connected to device with CAN ID 0 dev_0. ROS would see topics like /dev_0/velocity/command and /dev_1/velocity/command created by the intermediate node and publish to the topic pertaining to dev_1. Then the intermediate node would see that message and pass it through dev_0 to eventually reach dev_1 over CAN.
  1. Create a custom ROS control system hardware for each robot using these CAN-chained controllers.

  2. Any other suggestions you may have.

Additional context
I am using ROS Humble and Ubuntu 22.04.

My specific use case of this is I am trying to control multiple VESC motor controllers using ROS2 Control. The VESC controllers are connected to each other over a CAN bus and the master VESC is connected to the system running ROS over USB serial.

I am using sbgisen/vesc to create the interface between my VESC controller and ROS.

@saikishor
Copy link
Member

Hello!

Why don't you use a System Hardware Component interface for this approach?. This can help you handle all your multi-actuator communication in a single plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants