ros-industrial / ros_canopen

CANopen driver framework for ROS (http://wiki.ros.org/ros_canopen)
GNU Lesser General Public License v3.0
336 stars 271 forks source link

reset node on initialization #334

Open jschleicher opened 5 years ago

jschleicher commented 5 years ago

Resetting the communication only loads default values for the pdo mapping in the motor firmware according to CiA 301. I suggest with this PR to also reset the application registers to get a roslaunch behaviour that is similar to a power-on-reset of the motor (firmware) to fully recover from errors and values from the previous run.

What do you think?

mathias-luedtke commented 5 years ago

In general: :+1: Unfortunately, some devices are not compatible with this change. E.g., Elmo devices seem to connect the CAN lines to ground during reset(), which breaks the CAN communication in a chain.

I am afraid, we have to make this somehow configurable.

mathias-luedtke commented 5 years ago

I am afraid, we have to make this somehow configurable.

What do you think of a deep_reset argument in an additional constructor (ABI..) that gets passed down from canopen_chain_node?

jschleicher commented 5 years ago

Sounds good. Probably this is better than an additional /reset service that the user can trigger in addtion before the /init service.