Structure of hardware_interfaces#10
Conversation
hardware_interfaces
|
|
Definitely excited to see the My other point of interest is around sharing resources between instances, which @bmagyar alludes to above. The ideal scenario for this kind of thing is where any needed multiplexing happens at the OS layer— eg, multiple processes can open a socketcan device and it all just magically works. But this is very much not the reality for many systems, especially when you have a single connection (serial, a socket, whatever) bridging into a separate system with multiple devices where those devices are variable and you'd like to handle them with separate instances of xHardware classes. The specific case of this that I was describing on the call last week is with systems which are accessible over register-based protocols. There are several systems like this in the industrial world (modbus, ethercat, profinet, canopen, etc) and it would be nice to be able to supply a suite of classes which permit plugging a |
This strongly reminds me of how ros_canopen works. Especially the "chain" and motor nodes (ie: canopen_chain_node). Conversion from registers to ROS and back is done (for 'simple' devices) using expressions you configure in a Edit: btw, this sounds like the typical opaque proxy vs transparent bridge design discussion. |
not finished yet but I have to switch computer.
|
Hi all, in this second iteration I managed to solve the following points: Nr. 2 - there is a separation between internal structures and HWInterfaces. Internal structures hold a reference to them and they are initialized on run-time. Nr. 3 - we go then with FlexibleJointStateMessage (or how it is called in the future. Nr. 6 - see comment to Nr. 2 - the robot developers are now free :) Note on the implementation: we should do some "handle"-stuff to provide access between internal structures and communication, i.e. if a robot uses "batch" communication, we should take care that data come into Sensor/Actuator structures. |
|
comment on Nr.1. should we use word "Joint" instead of "Actuator".Because almost every actuator has a possibility to know (read) its own state. Only problem in semantics is when one has e.g., a drilling machine on the TCP, because it is not actually a joint. |
|
Dear @destogl , the SVG diagram is very nice.
|
|
Hi @olivier-stasse, Thank you for your comments! Here the answers:
|
Karsten1987
left a comment
There was a problem hiding this comment.
Thanks for the design doc. I like the overall Motivation and the composition of an abstract robot instance with various actuators and sensors.
I got a bit lost with the three packages you want to introduce. Are these mainly interface classes or abstract base classes for predefined hardware components? It wasn't really clear to me what each user has to implement per robot. Basically, I wasn't sure what you mean with class, whether it's an interface the user has to implement or a library providing functionality.
I guess it would be great to have another SVG which depicts a smaller, less complex setup. Maybe a single off-the-shelf robot.
ros2_control_components:
- I got a bit confused with what exactly a
BaseComponententails. Is that a common base interface whichSensorandActuatorinherit from? If so, what common functionality do you see in thatBaseComponent? - The
Robotinterface makes a lot of sense from what you've described. However, I couldn't find that pattern in your SVG. In your example, I would have expected that there are twoRobotimplementations (i.e.KukaandSchunk) and a third implementation which only holds two references toKukaandSchunk. A recursive relationship so to say.
ros2_control_hardware_interface:
- Given the comments above, can you elaborate once more what's the difference between the hardware interfaces and the component class?
design_drafts/hardware_interface.md
Outdated
| ### Robot Hardware | ||
|
|
||
| A robot is logically represented with the `RobotHardware` class. | ||
| This structure has at least one sensor and one actuator, but it generally represents any composition of `RobotHardware`, `SensorHardware`, and `ActuatorHardware` structures. |
There was a problem hiding this comment.
why does it have at least one sensor and one actuator? What if I have "blind" robot structure, where I can solely control some motors without reading their states?
There was a problem hiding this comment.
Also, how are motors with encoders treated here? Do they count as one SensorHardware and one ActuatorHardware?
There was a problem hiding this comment.
This is a good point. I am not sure if we can assume that any Actuator knows its state. Or do we need something like IntelligentActuator (not very good name) which is Sensor and Actutator in one structure.
Basicaly a user should implement only
I made reduced version of the chart. I hope this makes everything clearer.
The order of inheritance is as follows: So, the Also, it helps to have clear split of
|
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
|
@destogl @Karsten1987 is this ready for merging? Could we get it in before the PR with code drops? |
|
@bmagyar: I will do one more review until this friday. There are still some typos in graphics. |
|
I updated the diagrams. The description still needs to be updated. I will do it today or latest tomorrow. |
This is now ready for review.
|
This description should be reviewed and revised according to current developments in ros-controls/ros2_control#101 and the project. |
Next steps
Open issues / discussion points
RobotHardwareSensorHardwareActuatorHardwareExample: industrial robot expects to read/write all data at once (
RobotHardwareshould do this); a sensor attached to it can be read separately (SensorHardwareshould do this).Timeparameter in read/write functions?controller key-approach is sensible to protect the actuator from multiple access or the controller's name is sufficient?RobotHardwarecommunicate in a separate thread with a physical hardware?