The current version relies on self.hand_velocity = dict(tmp_vel)
being atomic and I don't think it is.
"When in doubt, use a mutex" the rule says!


Cheers
Manos Nikolaidis

Software Team
Shadow Robot Company. 251 Liverpool Road, London U.K. N1 1LX
Tel: +44 (0) 20 7700 2487 E: manos@shadowrobot.com



On 28 March 2014 09:50, toliver <notifications@github.com> wrote:

> In sr_hand/scripts/sr_hand/shadowhand_ros.py:
>
> > @@ -378,6 +384,18 @@ def read_all_current_targets(self):
> >              self.dict_tar[joint.joint_name] = joint.joint_target
> >          return self.dict_tar
> >
> > +    def read_all_current_velocities(self):
> > +        """
> > +        @return: dictionary mapping joint names to current velocities
> > +        """
> > +        return dict(self.hand_velocity)
>
> OK, but then I'll add some mutex to avoid the dictionary being returned
> while it's still being written. That happens in the topic callback thread.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/shadow-robot/sr-ros-interface/pull/117/files#r11059713>
> .
>

-- 

------------------------------
*Shadow Robot Company Ltd.*
251 Liverpool Road, N1 1LX, UK
Registered Number 3308007 (England & Wales)

RoNeX - Building Robots with ROS Made Easy 
http://www.shadowrobot.com/products/ronex/
------------------------------