gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.21k stars 484 forks source link

Copying PID as reference pointer #3216

Open jeanchristopheruel opened 2 years ago

jeanchristopheruel commented 2 years ago

https://github.com/osrf/gazebo/blob/72d47eb0f08e24d8a5c570d26c6e360d97ab9242/gazebo/physics/JointController.cc#L473-L483 this->dataPtr->posPids[_jointName] = _pid; where _pid is a reference pointer. This is really discouraged as it can lead in an Undefined behavior. A shared_ptr or unique_ptr should be passed instead.