ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames.
The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform out data such data they fit on a sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames.
The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform out our data such data so that they fit are on a sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames.
The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data so that they are all on a the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames.
The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data so that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector..
TLDR: Obtain magnetic field data by rotating the sensor while staying close to one point and then use the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames.
Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data so such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: Obtain magnetic field data by rotating the sensor while staying close to one point and then use the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot and then use the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot and then use the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: 1- Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot and then use robot. If the sensor is close to the motors, turn them on. Their magnetic field might also distort the readings!
2- Use
the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see the it is possible to fit a nice sphere shape on the raw data which means that the matrix is close to identity. But the origin of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: 1- Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot. If the sensor is close to the motors, turn them on. Their magnetic field might also distort the readings!
2- Use the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see it is possible to fit a nice sphere spherical shape on the raw data which means that the matrix is close to identity. But the origin center of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: 1- Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot. If the sensor is close to the motors, turn them on. Their magnetic field might also distort the readings!
2- Use the Matlab function.

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see it is possible to fit a spherical shape on the raw data which means that the matrix is close to identity. But the center of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: 1- Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot. If the sensor is close to the motors, turn them on. Their magnetic field might also distort the readings!
2- Use the Matlab function.function.
Update: 1- This method works on the basis of staying close to a point (constant magnetic field). I'm not sure about the earth's magnetic field gradients on the course you have taken (which seems very long) but maybe the assumption of constant field is not valid. Perhaps you should check the data for earth's magnetic field.
2- Have you tried running the Matlab script that I posted above with your data set?

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see it is possible to fit a spherical shape on the raw data which means that the matrix is close to identity. But the center of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: 1- Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot. If the sensor is close to the motors, turn them on. Their magnetic field might also distort the readings!
2- Use the Matlab function.
Update: 1- This method works on the basis of staying close to a point (constant magnetic field). I'm not sure about the earth's magnetic field gradients on the course you have taken (which seems very long) but maybe the assumption of constant field is not valid. Perhaps you should check the data for earth's magnetic field.

2- Have you tried running the Matlab script that I posted above with your data set?

1- The earth magnetic field at point P in space is a vector with constant magnitude.
Ideally, you should rotate the magnetometer in one point. This way you obtain the components of the same vector in different frames. Do this in the setting you're planning to use the sensor. The magnitude of a vector is independent of the frame. Therefore for any data point you should have

||v|| = c

Where c is the magnitude of the magnetic field at point P. That is equation of a sphere with the origin as center! So we have to transform our data such that they are all on the same sphere.
It involves subtracting a vector and multiplying a matrix. Read more about the theory here.
2- I have written a nice and simple Matlab function. It uses the ellipsoid_fit function found here. An example output with real data: image description
As you can see it is possible to fit a spherical shape on the raw data which means that the matrix is close to identity. But the center of the sphere should be transferred to the origin ( [0,0,0]) and you can do so by subtracting the vector.
TLDR: 1- Obtain magnetic field data by rotating the sensor while staying close to one point while it's on the robot. If the sensor is close to the motors, turn them on. Their magnetic field might also distort the readings!
2- Use the Matlab function.
Update:
1- This method works on the basis of staying close to a point (constant magnetic field). I'm not sure about the earth's magnetic field gradients on the course you have taken (which seems very long) but maybe the assumption of constant field is not valid. Perhaps you should check the data for earth's magnetic field.

2- Have you tried running the Matlab script that I posted above with your data set?