ros-industrial/ros_canopen

[canopen_motor_node] variable initialization

vincentrou opened this issue · 1 comments

The commands variables for velocity and effort in the HandleLayer class are not initialzed.
https://github.com/ros-industrial/ros_canopen/blob/melodic-devel/canopen_motor_node/include/canopen_motor_node/handle_layer.h#L89

I think they should be initialized to zero to avoid bad init with non zero cmd.

In this case the value should be managed by hardware_interface::JointHandle. And if the JointHandle is not active, it will be overwritten anyway.

Any fixed value for the commands (especially cmd_pos_) is wrong, but It is okay to set it to 0 to just make any static code analyzer happy :)