Page 1 of 1

compass (magnetic) sensor

Posted: 16 Oct 2013, 20:54
by fferri
has anyone ever attempted creating a magnetic sensor?

those sensors are used in reality for measuring the magnetic field along the three axes X, Y and Z.
this (eventually in conjunction with an accelerometer) can be used to obtain the orientation of the magnetic north.

how to make such a sensor in V-REP?

one possible solution can be of "faking" the magnetic field by using the sensor orientation w.r.t. the world frame.

however it would not be possible to simulate a magnetic field interference by a secondary magnetic source (such an interference can be detected by observing a change in the modulo of the magnetic field)

Re: compass (magnetic) sensor

Posted: 17 Oct 2013, 09:59
by coppelia
Hello,

as you describe it, there is the simple solution, which is to fake the magnetic field using the sensor orientation.

But you can always create an elaborate solution. One of the many ways I see would be for example:
  • have a child script attached to an object that represents the magnetic sensor.
  • have several dummies in the scene, that could represent magnetic sources or disturbances.
  • the child script of the magnetic sensor would then parse all those dummies for its calculation.
Cheers

Re: compass (magnetic) sensor

Posted: 17 Oct 2013, 14:59
by fferri
here is the simple magnetic sensor.

it requires setting the magnetic vector for the current geographic location (default: {0,1,0})

http://dfiles.eu/files/m7mnv5kiu