ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

behavior of start/stop in new ros2_controls system interface

asked 2021-02-15 18:09:36 -0500

guru_florida gravatar image

If I understand correctly, the proper use of start/stop in a controller's system interface is for switching between robot operating modes such as position control to effort or velocity control usually via switch_controllers service call. This makes sense for Position|Velocity|EffortJointController ones, but what is the purpose of switch_controllers on a hardware (system) interface? If we are communicating with real hardware via a communications bus should we be opening/closing the port in start/stop? ...or in the initial configure() method?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-02-16 04:57:06 -0500

updated 2021-02-17 08:48:59 -0500

Hi,

What do you mean with "switch_controllers" on the hardware_interface? Currently, there is no such a function.

UPDATE: The controllers and hardware interfaces are completely independent component. Therefore, "switch_controlller" only call start() and stop() methods on the controllers and the hardware interface keeps running. The start()and stop() methods of the hardware are currently not used. They are added as part of the interface to enable hardware-recovery after emergency stop and tool changers (switching of tools). In the foreseeable future will add additional service to the Controller Manager to start and stop hardware.

Regarding start() and stop() methods for the hardware, they should change HW state to "able_to_move" and "not_able_to_move". In the configure() method, you want to initialize port/communication interface and set-up robot if needed (closing is usually done in destructor). start() method then takes care that the HW can receive commands using write() method.

edit flag offensive delete link more

Comments

There is switch_controller service call on the Controller Manager. Does this not call stop/start on hardware interfaces and other ros2 controllers? I'm perhaps getting hardware interface stop/start confused with the software joint controllers that do position, velocity or effort control. it makes sense to switch between position and effort control, for example, but doesn't make much sense to switch hardware.

So port open should be in config(), ok. Close would be in destructor then.

guru_florida gravatar image guru_florida  ( 2021-02-16 12:10:07 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2021-02-15 18:09:36 -0500

Seen: 481 times

Last updated: Feb 17 '21