How to Send Joint Velocity Commands to Kinova Gen3 in Simulink Using KORTEX SDK?
Hello,
I am currently working on implementing a closed-loop IBVS (Image-Based Visual Servoing) control for a Kinova Gen3 robotic arm in Simulink. I calculate joint velocities using a PID-based visual servo control law and would like to send these velocities directly to the robot.
I am following the example from the Connect to Kinova Gen3 from Simulink demo (link: (https://www.mathworks.com/help/robotics/robotmanipulator/ug/connect-gen3-simulink.html), which uses two System objects: 1. TrajectoryFeeder 2. KORTEX Main (provided via kortex.m from Kinova's SDK)
From what I understand, the kortex.m interface currently supports: 1. SendJointAngles 2. SendPreComputedTrajectory
However, it does not include a method like SendJointSpeeds() to send joint velocities directly.
My Questions: 1. Should I extend kortex.m to add a method like the following to send joint velocities?
function [isOk] = SendJointSpeeds(obj, joint_vel_cmd) if coder.target('MATLAB') [result] = kortexApiMexInterface('SendJointSpeeds', obj.apiHandle, joint_vel_cmd); isOk = result == KortexErrorCodes.SUB_ERROR_NONE; else result = coder.ceval('kapi_SendJointSpeeds', obj.apiHandle, ... coder.ref(joint_vel_cmd), uint32(obj.nbrJointActuators)); isOk = result == KortexErrorCodes.SUB_ERROR_NONE; end end
2. Or instead, should I use the existing SendPreComputedTrajectory() function by:
Setting position(:, i+1) = position(:, i) + velocity(:, i) * dT; Keeping acceleration as zeros Setting a fixed dT and corresponding timestamp_sec array
I would appreciate any guidance on which approach is preferred, especially for real-time deployment or when using code generation.
Thanks in advance!
Best Regards,
0 Comments
Answers (1)
0 Comments
See Also
Categories
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!