compass (magnetic) sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

compass (magnetic) sensor

Post 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)

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: compass (magnetic) sensor

Post 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

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: compass (magnetic) sensor

Post 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

Post Reply