I am working on getting the Peter Corke Robotics Toolbox for Matlab connected to a Panda robot via Simulink. The problem I am encountering is the fact that the variables created by the Peter Corke Toolbox are not recognized by Simulink. I want to feed a function block with joint angles and end-effector velocities and then have the block output the joint velocities. This is done via the following multiplication:
$\dot{q}=J(q)^{\dagger} \dot{p}$. Executing this multiplication in Matlab is easy and straightfoward using the toolbox. You can get $J$ using robot.jacobe(q)
and then take the pseudo-inverse and multiply this with the end-effector velocities $\dot{p}$.
The problem arises as soon as I try to execute this same multiplication in Simulink. The function block along with its inputs and outputs is shown below:
The function block contains the same script as the m-file that correctly outputs the joint velocities in Matlab. When I build the Simulink model, I get a multitude of error messages. Caused by the fact that Simulink does not recognize the SerialLink object (shown below) created by the Peter Corke Robotics Toolbox.
I've tried converting everything to a struct but then the toolbox's Jacobian function no longer works (unsurprisingly). Is there anybody that has experience with using SerialLink object in Simulink or is there a simple way to get the robot data into Simulink?
Thanks a lot in advance, for any help and or tips.