personalrobotics / aikido

Artificial Intelligence for Kinematics, Dynamics, and Optimization
https://personalrobotics.github.io/aikido/
BSD 3-Clause "New" or "Revised" License
213 stars 30 forks source link

RosJointStateClient is a bit of a mess #613

Open egordon opened 2 years ago

egordon commented 2 years ago

There are a few key issues with the RosJointStateClient: https://github.com/personalrobotics/aikido/blob/master/src/control/ros/RosJointStateClient.cpp

(1) There's no reason to lock the mSkeleton mutex in spin, since we don't read or write from it at all.

(2) There is not reason to store the mSkeleton pointer anyway, since we never use it.

(3) We should decide on a better interface. Either [1] we should pass in a MetaSkeletonPtr (assuming the parent skeleton is already locked) and set the corresponding (subset of) DoFs directly, or [2] we should just return a copy of the buffer as a map from DoF name to position, and have the client set their own MetaSkeleton accordingly.