0

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.

2
  • 1
    This might help you Commented Apr 26, 2024 at 11:39
  • 1
    You’re looking for the WindowButtonMotionFcn callback. Commented Apr 26, 2024 at 14:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.