petercorke / robotics-toolbox-matlab

Robotics Toolbox for MATLAB
GNU Lesser General Public License v2.1
1.26k stars 440 forks source link

Negative values for prismatic joints available in 2020b #100

Closed bedlamzd closed 3 years ago

bedlamzd commented 3 years ago

MATLAB version: 2020b

Not an issue, just kind of a notification I guess.

I encountered a problem where my prismatic joint of SCARA robot on simple simulation with gravity only broke because of constraint on negative values for the coordinate of a prismatic joint.

This line of code, to be specific https://github.com/petercorke/robotics-toolbox-matlab/blob/bd7a9d75176c660f43fc799b24d838f70b02250c/%40SerialLink/animate.m#L93

So I found this thread where it was stated this is due to inner restrictions of MATLAB.

But I experimented a bit by deleting assertion above and all seems to work almost fine.

>> robot.animate([0 0 -30 0])

image

The only issue is that there is no visual for the link in that case. But I think it is better then inability to use negative values at all.

bedlamzd commented 3 years ago

Also, you don't have to answer this but

Z-axis of my prismatic joint points down and I would expect its positive movement to happen in direction of its Z-axis. But that's not the case and it seems that it is actually in direction of previous link Z-axis (which points in the opposite direction).

So am I being stupid and this is how DH parameters work or is it quirk of the toolbox?