I am working on a teleoperation task and simulation between Matlab and Gazebo. For that I made a funtion to read the position of my mouse, so the will be the master and the simulation in Gazebo the slave. Right now, I have to click the mouse every time I want to save a nwe position. I want to change it so you dont have to click, just move the mouse around the space.
function MouseClickCallback(~, ~)
global desired_position;
% Get the cord from the click point
coordinates = get(gca, 'CurrentPoint');
coordinates = coordinates(1, 1:3) % Get x, y, z
desired_position = [desired_position; coordinates];
% disp(desired_position);
calculateInverseKinematic(coordinates);
end
I am sure there should be another type of event which can read the mouse continuosly, but I haven't found it yet.
WindowButtonMotionFcncallback.