Giter Site home page Giter Site logo

v-rep-simulation-projects's Introduction

V-REP-Simulation-Projects

Learning Robotics by Playing with V-REP

NOTE: ALL of the projects are successfully run on V-REP 4.1 and MATLAB 2020a

The right way to use force sensor in V-REP (4 steps totally, the step 3 is crucial to guarantee the validity of force/torque data)

1. get force sensor handle

[res,forcesensor] = vrep.simxGetObjectHandle(id,'Force_sensor',vrep.simx_opmode_oneshot_wait);

2. data streaming

vrep.simxReadForceSensor(id,forcesensor,vrep.simx_opmode_streaming);

3. read the first available data

while (1)  
   [res,state,f,tau] = vrep.simxReadForceSensor(id,forcesensor,vrep.simx_opmode_buffer);
   if res == vrep.simx_return_ok && state == 1
      break;
   else
      disp('force sensor data is not available!');
      pause(0.1);
   end
end

4. read force data periodically in control loop

while vrep.simxGetConnectionId(id)~=-1
   [res,state,f,tau] = vrep.simxReadForceSensor(id,forcesensor,vrep.simx_opmode_buffer);
end

v-rep-simulation-projects's People

Contributors

xuhuairuogu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.