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

How to pass additional information to the hardware interface #1016

Open
guidout opened this issue May 10, 2023 · 3 comments
Open

How to pass additional information to the hardware interface #1016

guidout opened this issue May 10, 2023 · 3 comments

Comments

@guidout
Copy link

guidout commented May 10, 2023

Background

Hi,
I have posted a question on Stack Exchange about CAN messages and hardware interfaces but I think the question can be generalized.

My issue (maybe it's already possible but I'm not aware of how) is how to pass additional information to the hardware interface besides commands and states.
In my use case, I have to interface with an existing vehicle CAN bus (so I can't change the messages' definitions) and the hardware interface will send steering and throttle commands to the existing vehicle module.
Each CAN message has more information than just the command and/or the sensor. So I need a way to get that information down to the hardware interface so that it can generate a complete CAN message.
This additional information could come either from a node or from a controller.

Is there an already existing mechanism to accomplish this?

Thank you in advance

@guidout guidout changed the title How to pass additional information to hardware interface How to pass additional information to the hardware interface May 10, 2023
@swiz23
Copy link

swiz23 commented May 18, 2023

This may be relevant. You can look at the Issue linked in the following PR #1012

Specifically, at least the way I intend to use that PR is as follows:

  • Specify some sort of unique string for 'command_data'.
  • In the ros2 control xacro file, have a bunch of params that have that unique string as a prefix. Then you can access that info in the hardware interface.

@destogl
Copy link
Member

destogl commented May 30, 2023

yes, please check how we have solved this in the ros2_canopen repository. There you can find ideas, the right amount of abstraction you have to do yourself.

@Xi-HHHM is just adding detailed docs about ros2_canopen, so this can also help you to understand the concepts - note that this description is subject to changes – we just want to structure this better.

Also note that I don't agree with @swiz23's solution as it can be solved much nicely.

@mateusmenezes95
Copy link
Contributor

This is an old issue, but for new people who are looking for a solution, an alternative to ros2_canopen could be the feature proposed in the PR #1240

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

No branches or pull requests

4 participants