fix bug to consider an offset value for the target position

 While checking if the target position was within the joint limits,
the offset value was only added to the joint limits but not to the target
position.