ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Could I introduce multiple subscribers in the diff_drive_controller plugin to gather this extra data from the ROS side?
I would not try to fudge this into the diff_drive_controller
.
In the end, ros_control
is a resource management framework. The job of the controller manager, together with the hardware_interface
is to make sure no two plugins claim the same resources at the same time. In most cases, concurrent read is OK, but concurrent write is not. Typical examples of such plugins are the controllers in ros_controllers
, which implement the type of controllers most people think of when hearing the words "control" (ie: PID and similar concepts from Control Engineering).
This additional data may not really make sense to be represented in the joint space so I’m unsure if a custom hardware interface such as the ones written for force-torque sensors, IMUs etc might make sense here.
It's actually perfectly fine to have your hardware_interface
make resources available which do not fall in that category (and which are probably not "in the joint space" (whatever you mean by that)), but which are to be used to communicate different kinds of abstractions between the ROS / ros_control
side and whatever representations the underlying hardware is comfortable with.
So you could do the following:
*Interface
and *Handle
pairs for those resources (this is ros_control
specific, look at the various implementations available in ros_control
already)hardware_interface
and expose it using the *Interface
and *Handle
you've defined earlier (so add a way for your hardware_interface
to read/write the list of Cartesian frames from/to your PLC and update whatever internal data structure you use to store that inside the hardware_interface
)Interface
s to get access to the data structures inside the hardware_interface
and which use Publisher
s and Subscriber
s to provide access to those resources (but in a real-time safe way, refer to the existing controllers to see how that can be done). These are of course not necessarily really "controllers", but that's just ros_control
nomenclature.yaml
file somewhere) to load the controllers you've written, making sure to provide them with the configuration they needAt this point you have a hardware_interface
which loads the diff_drive_controller
and in addition a bunch of other controllers (really: plugins) which together expose an interface to the resources of your PLC (which would include actuators, sensors and other types of (derived) data).
Those controllers together expose a set of topics (and/or services and actions) which allow your ROS application access to the resources of your PLC (and if you'd want to, the other way around).
Some advantages of doing it this way:
hardware_interface
hardware_interface
is responsible for communication with the hw itselfX
? Simply don't load the controllerhardware_interface
which doesn't talk to a PLC, but is capable of exposing the same Interface
? You can now reuse the plugin/controller you wrote earlierThere are a few more, but these are the bigger ones.
How do I go about achieving this in a way that can be easily extended for newer data that I might want to send to the hardware (PLC)?
This should now be obvious: by creating more plugins (ie: controllers).
[..] am I over complicating this?
Well, adding abstractions tends to increase complexity (almost paradoxical this statement), and if you look at the nr of steps I listed to add the infrastructure to your hardware_interface
which would "properly" expose the additional information you want from your PLC, you could say it's a bit convoluted.
In the end however I believe the benefits outweigh the costs, and experience also tells me it's worth the initial investment (adding support for new data types typically comes down to copy-paste almost). Especially re-use of controller plugins is a really nice way to end up with a flexible system, and the almost stand-alone nature of those plugins makes them relatively easy to manage and test as well.
2 | No.2 Revision |
Could I introduce multiple subscribers in the diff_drive_controller plugin to gather this extra data from the ROS side?
I would not try to fudge this into the diff_drive_controller
.
That would make no sense to me: diff_drive_controller
has a very narrowly defined scope and responsibility. Would it make sense for it to know/have to deal with the current waypoint or the goal status?
Now I plan to send some extra information to the PLC, such as current waypoint, pose, goal status etc as part of the “telegram” (in the Write method). [..]. This information is internally published on various topics from different nodes and has to be inserted into the PC-PLC real time communication.
In the end, ros_control
is a resource management framework. The job of the controller manager, together with the hardware_interface
is to make sure no two plugins claim the same resources at the same time. In most cases, concurrent read is OK, but concurrent write is not. Typical examples of such plugins are the controllers in ros_controllers
, which implement the type of controllers most people think of when hearing the words "control" (ie: PID and similar concepts from Control Engineering).
This additional data may not really make sense to be represented in the joint space so I’m unsure if a custom hardware interface such as the ones written for force-torque sensors, IMUs etc might make sense here.
It's actually perfectly fine to have your hardware_interface
make resources available which do not fall in that category (and which are probably not "in the joint space" (whatever you mean by that)), but which are to be used to communicate different kinds of abstractions between the ROS / ros_control
side and whatever representations the underlying hardware is comfortable with.
So you could do the following:
*Interface
and *Handle
pairs for those resources (this is ros_control
specific, look at the various implementations available in ros_control
already)hardware_interface
and expose it using the *Interface
and *Handle
you've defined earlier (so add a way for your hardware_interface
to read/write the list of Cartesian frames from/to your PLC and update whatever internal data structure you use to store that inside the hardware_interface
)InterfaceHandle
s to get access to the data structures inside the hardware_interface
and which use Publisher
s and Subscriber
s to provide access to those resources (but in a real-time safe way, refer to the existing controllers to see how that can be done). These are of course not necessarily really "controllers", but that's just ros_control
nomenclature.yaml
file somewhere) to load the controllers you've written, making sure to provide them with the configuration they needAt this point you have a hardware_interface
which loads the diff_drive_controller
and in addition a bunch of other controllers (really: plugins) which together expose an interface to the resources of your PLC (which would include actuators, sensors and other types of (derived) data).
Those controllers together expose a set of topics (and/or services and actions) which allow your ROS application access to the resources of your PLC (and if you'd want to, the other way around).
Some advantages of doing it this way:
hardware_interface
hardware_interface
is responsible for communication with the hw itselfX
? Simply don't load the controllerhardware_interface
which doesn't talk to a PLC, but is capable of exposing the same Interface
? You can now reuse the plugin/controller you wrote earlierThere are a few more, but these are the bigger ones.
How do I go about achieving this in a way that can be easily extended for newer data that I might want to send to the hardware (PLC)?
This should now be obvious: by creating more plugins (ie: controllers).
[..] am I over complicating this?
Well, adding abstractions tends to increase complexity (almost paradoxical this statement), and if you look at the nr of steps I listed to add the infrastructure to your hardware_interface
which would "properly" expose the additional information you want from your PLC, you could say it's a bit convoluted.
In the end however I believe the benefits outweigh the costs, and experience also tells me it's worth the initial investment (adding support for new data types typically comes down to copy-paste almost). Especially re-use of controller plugins is a really nice way to end up with a flexible system, and the almost stand-alone nature of those plugins makes them relatively easy to manage and test as well.
3 | No.3 Revision |
Could I introduce multiple subscribers in the diff_drive_controller plugin to gather this extra data from the ROS side?
I would not try to fudge this into the diff_drive_controller
.
That would make no sense to me: diff_drive_controller
has a very narrowly defined scope and responsibility. Would it make sense for it to know/have to deal with the current waypoint or the goal status?
Now I plan to send some extra information to the PLC, such as current waypoint, pose, goal status etc as part of the “telegram” (in the Write method). [..]. This information is internally published on various topics from different nodes and has to be inserted into the PC-PLC real time communication.
In the end, ros_control
is a resource management framework. The job of the controller manager, together with the hardware_interface
is to make sure no two plugins claim the same resources at the same time. In most cases, concurrent read is OK, but concurrent write is not. Typical examples of such plugins are the controllers in ros_controllers
, which implement the type of controllers most people think of when hearing the words "control" (ie: PID and similar concepts from Control Engineering).Engineering). But there is nothing which limits ros_control
controllers to those kinds of controllers.
This additional data may not really make sense to be represented in the joint space so I’m unsure if a custom hardware interface such as the ones written for force-torque sensors, IMUs etc might make sense here.
It's actually perfectly fine to have your hardware_interface
make resources available which do not fall in that category (and which are probably not "in the joint space" (whatever you mean by that)), but which are to be used to communicate different kinds of abstractions between the ROS / ros_control
side and whatever representations the underlying hardware is comfortable with.
So you could do the following:
*Interface
and *Handle
pairs for those resources (this is ros_control
specific, look at the various implementations available in ros_control
already)hardware_interface
and expose it using the *Interface
and *Handle
you've defined earlier (so add a way for your hardware_interface
to read/write the list of Cartesian frames from/to your PLC and update whatever internal data structure you use to store that inside the hardware_interface
)Handle
s to get access to the data structures inside the hardware_interface
and which use Publisher
s and Subscriber
s to provide access to those resources (but in a real-time safe way, refer to the existing controllers to see how that can be done). These are of course not necessarily really "controllers", but that's just ros_control
nomenclature.yaml
file somewhere) to load the controllers you've written, making sure to provide them with the configuration they needAt this point you have a hardware_interface
which loads the diff_drive_controller
and in addition a bunch of other controllers (really: plugins) which together expose an interface to the resources of your PLC (which would include actuators, sensors and other types of (derived) data).
Those controllers together expose a set of topics (and/or services and actions) which allow your ROS application access to the resources of your PLC (and if you'd want to, the other way around).
Some advantages of doing it this way:
hardware_interface
hardware_interface
is responsible for communication with the hw itselfX
? Simply don't load the controllerhardware_interface
which doesn't talk to a PLC, but is capable of exposing the same Interface
? You can now reuse the plugin/controller you wrote earlierThere are a few more, but these are the bigger ones.
How do I go about achieving this in a way that can be easily extended for newer data that I might want to send to the hardware (PLC)?
This should now be obvious: by creating more plugins (ie: controllers).
[..] am I over complicating this?
Well, adding abstractions tends to increase complexity (almost paradoxical this statement), and if you look at the nr of steps I listed to add the infrastructure to your hardware_interface
which would "properly" expose the additional information you want from your PLC, you could say it's a bit convoluted.
In the end however I believe the benefits outweigh the costs, and experience also tells me it's worth the initial investment (adding support for new data types typically comes down to copy-paste almost). Especially re-use of controller plugins is a really nice way to end up with a flexible system, and the almost stand-alone nature of those plugins makes them relatively easy to manage and test as well.
4 | No.4 Revision |
Could I introduce multiple subscribers in the diff_drive_controller plugin to gather this extra data from the ROS side?
I would not try to fudge this into the diff_drive_controller
.
That would make no sense to me: diff_drive_controller
has a very narrowly defined scope and responsibility. Would it make sense for it to know/have to deal with the current waypoint or the goal status?
Now I plan to send some extra information to the PLC, such as current waypoint, pose, goal status etc as part of the “telegram” (in the Write method). [..]. This information is internally published on various topics from different nodes and has to be inserted into the PC-PLC real time communication.
In the end, ros_control
is a resource management framework. The job of the controller manager, together with the hardware_interface
is to make sure no two plugins claim the same resources at the same time. In most cases, concurrent read is OK, but concurrent write is not. Typical examples of such plugins are the controllers in ros_controllers
, which implement the type of controllers most people think of when hearing the words "control" (ie: PID and similar concepts from Control Engineering). But there is nothing which limits ros_control
controllers to those kinds of controllers.
This additional data may not really make sense to be represented in the joint space so I’m unsure if a custom hardware interface such as the ones written for force-torque sensors, IMUs etc might make sense here.
It's actually perfectly fine to have your hardware_interface
make resources available which do not fall in that category (and which are probably not "in the joint space" (whatever you mean by that)), but which are to be used to communicate different kinds of abstractions between the ROS / ros_control
side and whatever representations the underlying hardware is comfortable with.
So you could do the following:
*Interface
and *Handle
pairs for those resources (this is ros_control
specific, look at the various implementations available in ros_control
already)hardware_interface
and expose it using the *Interface
and *Handle
you've defined earlier (so add a way for your hardware_interface
to read/write the list of Cartesian frames from/to your PLC and update whatever internal data structure you use to store that inside the hardware_interface
)Handle
s to get access to the data structures inside the hardware_interface
and which use Publisher
s and Subscriber
s to provide access to those resources (but in a real-time safe way, refer to the existing controllers to see how that can be done). These are of course not necessarily really "controllers", but that's just ros_control
nomenclature.yaml
file somewhere) to load the controllers you've written, making sure to provide them with the configuration they needAt this point you have a hardware_interface
which loads the diff_drive_controller
and in addition a bunch of other controllers (really: plugins) which together expose an interface to the resources of your PLC (which would include actuators, sensors and other types of (derived) data).
Those controllers together expose a set of topics (and/or services and actions) which allow your ROS application access to the resources of your PLC (and if you'd want to, the other way around).
Some advantages of doing it this way:
hardware_interface
hardware_interface
is responsible for communication with the hw itselfX
? Simply don't load the controllerhardware_interface
which doesn't talk to a PLC, but is capable of exposing the same Interface
? You can now reuse the plugin/controller you wrote earlierThere are a few more, but these are the bigger ones.
How do I go about achieving this in a way that can be easily extended for newer data that I might want to send to the hardware (PLC)?
This should now be obvious: by adding additional *Interface
and *Handle
classes, adding support for those to your hardware_interface
and then creating more plugins (ie: controllers).controllers). But only if needed: if you already have a controller which is capable of working with the resource you'd like to expose, you wouldn't need a new one of course.
[..] am I over complicating this?
Well, adding abstractions tends to increase complexity (almost paradoxical this statement), and if you look at the nr of steps I listed to add the infrastructure to your hardware_interface
which would "properly" expose the additional information you want from your PLC, you could say it's a bit convoluted.
In the end however I believe the benefits outweigh the costs, and experience also tells me it's worth the initial investment (adding support for new data types typically comes down to copy-paste almost). Especially re-use of controller plugins is a really nice way to end up with a flexible system, and the almost stand-alone nature of those plugins makes them relatively easy to manage and test as well.