Skip to content

Prevent 'bad weak_ptr exception' when copying return from getRobotNameHelper()

The RobotNameHelper uses shared_from_this, which makes copying the class very dangerous. E.g. an 'auto rnh = getRobotNameHelper();' inevitably lead to this error as the the rnh was copied (returned const ref and auto drops const refs --> the type of rnh was RobotNameHelper). To prevent this happening to unknowing users, it now returns a shared_ptr:

Signed-off-by: robdekon_h2t robdekon@kit.edu

Merge request reports