The first section of this chapter 6.1 will investigate how movement parameters can be determined with marker-based systems. Optical Recording Systems (ORS), like the system from Zeiss shown in Fig. 6.1, can provide high-resolution position information for markers attached to objects. This allows to directly determine object position and orientation in space. In contrast, Inertial Measurement Units (IMUs), which will be described in more detail in the next Sect. 6.2, indicate linear acceleration and angular velocity and contain no direct information about the absolute position and orientation of the object in space.

6.1 Position and Orientation from Optical Sensors

A good overview of the conceptual background underlying the reconstruction of human skeletal motion is given in the Handbook of Human Motion, in the chapter by (Camomilla and Vannozzi 2018). And the estimation of dynamic 3-D pose based on optical motion capture systems is described in (Selbie and Brown 2018). The presentation here focusses on the kinematic principles underlying the 3-D analysis.

6.1.1 Recording 3-D Markers

To define position and orientation of an object in three dimensions, one needs to find the positions of three points \(\mathbf {p_i}(t)\) that are firmly connected to the object. The only requirements for these points are that they (a) are visible, and (b) must not be arranged along a line.

In the example sketched out in Fig. 6.2, three markers are attached to the left lower arm. Assume that the positions of these markers have been recorded, and stored as \(\mathbf {p_i}(t), i = 0,1,2\). To investigate the object dynamics, the following questions have to be answered:

  1. 1.

    What are the positions \(\mathbf {x}(t)\), linear velocities \(\mathbf v(t) = \frac{\mathrm{d}\mathbf {x} (t)}{\mathrm{d}t}\), and linear accelerations \(\mathbf {acc}(t) = \frac{\mathrm{d}^2\mathbf {x}(t)}{\mathrm{d}t^2}\) of the markers, with respect to our chosen space-fixed coordinate system?

  2. 2.

    What are the resulting orientation \(\mathbf {R}(t)\), angular velocity \(\varvec{\upomega }(t)\), and angular acceleration \(\frac{\mathrm{d}\varvec{\upomega }}{\mathrm{d}t}\) of the markers?

  3. 3.

    What are the locations of the markers relative to the point(s) of interest on the object, in an object-fixed reference system?

Fig. 6.1
figure 1

(with kind permission from Carl Zeiss Optotechnik GmbH)

Optical recording system

Fig. 6.2
figure 2

Recording movements of the lower arm with optical markers. (Left) \(\mathbf {p}_i\) indicate the position of the markers, “\(\circ \)” the middle of the markers, and “*” the location of the Center of Mass (COM). (Right) Active markers for 3-D position measurements, for the Optotrak-system

The position of an object is typically taken to be its “center of mass” (COM), sometimes also called “center of gravity” . The COM is in general given by

$$\begin{aligned} \mathbf {COM}(t) = \frac{\sum \limits _{i = 0}^{n-1} {m_i * \mathbf {x}_i}(t)}{\sum \limits _{i = 0}^{n-1} {m_i}} \end{aligned}$$
(6.1)

where \(\mathbf {x}_i\) are the locations of the mass elements \(m_i\). Since the three markers have the same “weight” \(m_i\), the position of the center of the markers can be calculated as

$$\begin{aligned} \mathbf {m}(t) = \frac{\sum \limits _{i = 0,1,2} {{\mathbf {p}_i}(t)} }{3} \end{aligned}$$
(6.2)

In Fig. 6.2, the position of the center of the markers is indicated with “\(\circ \)”. With \(\mathbf {c}(t)\) defined as the location of the COM, the vector \(\mathbf {r}(t)\) from the markers to the COM is given by

$$\begin{aligned} \mathbf r(t) = \mathbf {c}(t) - \mathbf {m}(t) \end{aligned}$$
(6.3)

6.1.2 Orientation in Space

To find the orientation of an object, one needs to find the rotation matrix \(\mathbf {R}\) describing the orientation of the object. Since a rotation matrix is given by three columns of orthogonal unit vectors, one needs to find three orthogonal unit vectors which are uniquely defined through the marker points \(\mathbf {p_i}(t)\) (see Fig. 6.3).

Let the center of the local, marker-fixed—and thereby object-fixed—coordinate system be determined by \(\mathbf {p_0}\), and the direction of the positive first coordinate axis by the vector \(\overrightarrow{\mathbf {p_0}\mathbf {p_1}}\). In general, the line \(\overrightarrow{\mathbf {p_0}\mathbf {p_2}}\) is not perpendicular to \(\overrightarrow{\mathbf {p_0}\mathbf {p_1}}\). So in order to uniquely define a normalized, right-handed coordinate system characterizing position and orientation of an object, one can use a procedure called “Gram–Schmidt Orthogonalization”Footnote 1:

$$\begin{aligned} \begin{array}{l} \mathbf {a_x} = \frac{\mathbf {p_1} - \mathbf {p_0}}{\left| \mathbf {p_1} - \mathbf {p_0} \right| }\\ \mathbf {a_z} = \frac{\mathbf {a_x} \times (\mathbf {p_2} - \mathbf {p_0})}{\left| \mathbf {a_x} \times (\mathbf {p_2} - \mathbf {p_0}) \right| } \\ \mathbf {a_y} = \mathbf {a_z} \times \mathbf {a_x}. \end{array} \end{aligned}$$
(6.4)

The three orthogonal unit vectors \(\mathbf {a_i}(t)\) define the columns of the rotation matrix \(\mathbf {R}\) which describes the orientation of the object

$$\begin{aligned} \mathbf {R}(t) = \left[ {\begin{array}{*{20}{c}} \mathbf {a_x}(t)&\mathbf {a_y}(t)&\mathbf {a_z}(t) \end{array}} \right] . \end{aligned}$$
(6.5)

Denoting the rotation of the object relative to the starting (or reference) orientation at \(t=t_0\) with \({{\mathbf {R}}_{mov}}\) leads to

$$\begin{aligned} \mathbf {R}(t) = \mathbf {R}_{mov}(t) \cdot \mathbf {R}(t_0). \end{aligned}$$
(6.6)
Fig. 6.3
figure 3

Gram–Schmidt Orthogonalization: calculation of three orthogonal unit vectors \(\left[ \mathbf {a}_x, \mathbf {a}_y, \mathbf {a}_z \right] \), uniquely defined by three points \(\left[ \mathbf {p}_0, \mathbf {p}_1, \mathbf {p}_2 \right] \)

Bringing \(\mathbf {R}(t_0)\) to the other side of Eq. (6.6), the rotation matrix characterizing the rotational movement is

$$\begin{aligned} \mathbf {R}_{mov}(t) = \mathbf {R}(t) \cdot \mathbf {R}(t_0)^{ - 1}. \end{aligned}$$
(6.7)

Note that rotation matrices are not the only way to describe the orientation of an object, and/or its angular movement. The same orientation/movement can also be described with equivalent quaternions (Eq. 4.14) or Gibbs vectors (Eq. 4.20).

6.1.3 Position in Space

Once the location of the markers and their orientation is known, the position of the COM (or any other point of interest) of the object is uniquely defined, even if the markers are mounted eccentrically to the COM. The movement of every point is given by the sum of the COM translation plus its rotation about the COM. With

$$\begin{aligned} \mathbf r(t) = {{\mathbf {R}}_{mov}}(t) \cdot \mathbf r({t_0}) \end{aligned}$$
(6.8)

and using Eq. (6.3), the movement of the COM is given by

$$\begin{aligned} \mathbf c(t) = \mathbf m(t) + \mathbf r(t) = \mathbf m(t) + {{\mathbf {R}}_{mov}}(t) \cdot \mathbf r({t_0}). \end{aligned}$$
(6.9)

This finally provides the 3-D position of the point of interest on the object.

6.1.4 Velocity and Acceleration

Linear Velocity and Acceleration

The equations for finding linear velocity and linear acceleration of an object are simple. If the position of an object is denoted with \(\mathbf {pos}(t)\), linear velocity and acceleration are given by (see Sect. 5.2):

$$\begin{aligned} \mathbf {vel}(t)&= \frac{\mathrm{d}\mathbf {pos}(t)}{\mathrm{d}t} \\ \nonumber \mathbf {acc}(t)&= \frac{\mathrm{d}^2 \mathbf {pos}(t)}{\mathrm{d}t^2}. \end{aligned}$$
(6.10)

Angular Velocity

From the orientation of an object the corresponding angular velocity \(\varvec{\upomega }\) can be calculated. Expressing the orientation with a quaternion \(\varvec{\tilde{q}}\), the angular velocity \(\varvec{\upomega }\) can be found with Eq. (5.13). Equivalently, when the orientation is described with Gibbs vectors, the angular velocity can be found with Eq. (5.20); and expressing the orientation with the nautical sequence, the angular velocity can be found with Eq. (5.21).

Angular Acceleration

The angular acceleration can be obtained from the angular velocity through simple differentiation

$$\begin{aligned} \mathbf {AngAcc} = \frac{\mathrm{d}\varvec{\upomega }}{\mathrm{d}t}. \end{aligned}$$
(6.11)

Note that while the noncommutativity of rotations requires more complex formulas to find the angular velocity from orientation, the angular acceleration is simply the time derivative of angular velocity!

6.1.5 Transformation from Camera- to Space-Coordinates

Orientation

The first step in the analysis of 3-D movement recordings is the determination of the position and orientation of the ORS with respect to the chosen space-fixed coordinate system.

The output of the data recorded by the ORS cannot be used directly, because they are relative to the recording system. Commonly the (x/y) directions for the recorded data are determined by the image plane of the optical sensor. x indicates the horizontal image direction, y the vertical image direction, and z completes a right-handed coordinate system \(CS_\mathrm{{ORS}} = [ \mathbf {x\, y\, z} ]\) (see Fig. 6.4).

To identify the position and orientation of the ORS relative to a space-fixed coordinate system \(CS_\mathrm{{space}} = [ \mathbf {x'\, y'\, z'} ]\), the following procedure can be applied: Let three marker points be positioned along the space-fixed coordinate system \(CS_\mathrm{{space}}\), such that

  1. 1.

    \(\mathbf {p_0}\) is at the center of \(CS_\mathrm{{space}}\).

  2. 2.

    The vector from \(\mathbf {p_0}\) to \(\mathbf {p_1}\) defines the space-fixed x-axis, \(\mathbf {x}'\).

  3. 3.

    The plane defined by \(\left( \mathbf {p}_0 , \mathbf {p}_1 , \mathbf {p}_2 \right) \) defines the space-fixed x/y-plane. (In practice, it is helpful if the vector from \(\mathbf {p_0}\) to \(\mathbf {p_2}\) points approximately in the direction of \(\mathbf {y}'\).)

\(\mathbf {p_0}\) indicates the position of the origin of \(CS_\mathrm{{space}}\) with respect to the ORS. Using a Gram–Schmidt orthogonalization, the rotation matrix \(\mathbf {R}\) indicating the orientation of \(CS_\mathrm{{space}}\) with respect to \(CS_\mathrm{{ORS}}\) is given by (see Fig. 6.4):

$$\begin{aligned} \mathbf {R} = [ \mathbf {x'\, y'\, z'} ]. \end{aligned}$$
(6.12)
Fig. 6.4
figure 4

Position of a Marker as seen from the ORS (\(\mathbf {m}\)), and as seen from a space-fixed coordinate system (\(\mathbf {m'}\))

6.1.6 Position

Relative to ORS: If the position of the marker as seen from the ORS is \(\mathbf {m}\), and the location of the center of \(CS_\mathrm{{space}}\) is indicated by \(\mathbf {p_0}\), then the vector from the center of \(CS_\mathrm{{space}}\) to the marker \(\mathbf {m}\) is given by

$$\begin{aligned} {\mathbf {m}'}_{ORS} = -\mathbf {p_0} + \mathbf {m}. \end{aligned}$$
(6.13)

Note that at this point the components of the vector are still expressed in the orientation of \(CS_{ORS}\)!!

Relative to Space: To get the components of \(\mathbf {m}'\) relative to \(CS_\mathrm{{space}}\), one has to take the orientation of \(CS_\mathrm{{space}}\) with respect to \(CS_\mathrm{{ORS}}\) into consideration, to obtain

$$\begin{aligned} \mathbf {m}'_\mathrm{{space}} = \mathbf {R}^{-1} * \mathbf {m}'_\mathrm{{ORS}}. \end{aligned}$$
(6.14)

Combining Eqs. (6.13) and (6.14) gives

$$\begin{aligned} \mathbf {m}'_\mathrm{{space}} = \mathbf {R}^{-1} * (\mathbf {m} - \mathbf {p_0}). \end{aligned}$$
(6.15)

6.2 Position and Orientation from Inertial Sensors

This section describes the calculation of the exact orientation and position in space, given IMU data from ideal linear accelerometers and gyroscopes (Sect. 6.2.1). The next chapter (“Sensor Integration”, Chap. 7) will present how “Kalman Filters” or other analysis procedures can be used to find optimal solutions to uncertain information, for data from real sensors that can contain offsets and drifts. For a more detailed comparison of different methods to analyze IMU data, a number of recommendable surveys are available (Filippeschi et al. 2017; Bergamini et al. 2014).

The information from an IMU supports the analysis of a “well-defined” problem. For each moment in time \(t_i\), the IMU provides six parameters: the three components of \(\varvec{\upomega }(t_i)\), plus the three components of \(\mathbf {acc}(t_i)\). The analysis must resolve six variables: the three components of the position vector \(\mathbf {x}\), and the three parameters defining the orientation, e.g., the quaternion vector \(\mathbf {q}\) (see Chap. 4). This poses a well-defined problem: there are equal numbers of input measurements and output variables. The solutions for orientation and position are presented in Sects. 6.2.1 and 6.2.2, respectively.

Note that since the IMU only provides information about the derivatives of position and orientation, the initial values for position, velocity, and orientation are required in order to find the unique position and orientation at time \(t_i\).

6.2.1 Orientation in Space

Inertial sensors typically provide the linear acceleration \(\mathbf {acc}\) and the angular velocity \({\varvec{\upomega }}\) of the sensor (in the sensor’s coordinate system). However, these values do not directly provide the movement of the sensor with respect to the fixed-space coordinate system: these values are measured by the moving sensor, which means that one obtains linear acceleration and angular velocity in sensor coordinates.

In the upcoming equations, the following notation will be used: \(\mathbf x^\mathrm{{space}}\) is a vector expressed in space coordinates, and \(\mathbf x^\mathrm{{object}}\) the corresponding vector locally expressed with respect to the object.

If the following information is available

  • the initial conditions \(\mathbf x({t_0}),\,{\mathbf {R}}({t_0}),\mathbf {vel} ({t_0})\),

  • the IMU output \(\mathbf {acc} ^\mathrm{{object}}(t_i)\) and \(\varvec{\upomega } ^\mathrm{{object}}(t_i)\) in sensor coordinates, and

  • the sampling period \(\Delta t\), assuming that this sampling period is constant,

one can calculate the new position and orientation in space, assuming that the linear acceleration and angular velocity remain approximately constant during a time interval \(\Delta t\).

Orientation measurements are independent of the linear acceleration, whereas the measured gravito-inertial acceleration (i.e., the output of the acceleration sensor) depends on the current orientation (see Eq. 2.7). Therefore, reconstruction of position and orientation from the sensor data has to start with the determination of object orientation. The orientation of an object is determined by its starting orientation and its angular velocity \({\varvec{\upomega }^\mathrm{{object}}}\) as described in the following.

Let the object under investigation start with its orientation with respect to space given by the rotation matrix \(\mathbf {R}_\mathrm{{object, start}}^\mathrm{{space}}\). The subsequent rotation of this object for a short duration \(\Delta t\) about a constant, space-fixed axis \(\mathbf {n}\) with a constant velocity \({\varvec{\upomega }^\mathrm{{space}}}\) is described by \(\Delta {\mathbf {R}}^\mathrm{{space}}\), which depends on the current axis of rotation (\(\mathbf {n}\)), the rotational speed (\(\varvec{\upomega }^\mathrm{{space}}\)), and the time duration of sampling (\(\Delta t)\). Since in combined rotations the rotation applied first (here the starting orientation) is written on the right-hand-side of the matrix multiplication (see Sect. 3.4), the new orientation of the object in fixed-space coordinates is given by

$$\begin{aligned} \mathbf {R}_\mathrm{{object,new}}^\mathrm{{space}} = \Delta {{\mathbf {R}}^\mathrm{{space}}} \cdot {\mathbf {R}}_\mathrm{{object, start}}^\mathrm{{space}}. \end{aligned}$$
(6.16)

Note that the correct sequence of the matrices in this matrix multiplication is essential.

The next analysis step is critical for the correct reconstruction of the object orientation in space: if the angular acceleration is recorded in the sensor/object coordinates (e.g., from an inertial tracking device mounted on the object), it first has to be transformed from the object-fixed reference frame to a space-fixed reference frame. Let \(\Delta {{\mathbf {R}}^\mathrm{{object}}}\) describe the movement as seen in the object coordinates, and \({\mathbf {R}}_\mathrm{{object}}^\mathrm{{space}}\) the orientation of the object with respect to space. Then according to Eq. (A.6), which describes how a rotation matrix transforms for a change of the coordinate system, the movement with respect to space is given by

$$\begin{aligned} \Delta {{\mathbf {R}}^\mathrm{{space}}} = {\mathbf {R}}_\mathrm{{object}}^\mathrm{{space}} \cdot \Delta {{\mathbf {R}}^\mathrm{{object}}} \cdot {\left( {{\mathbf {R}}_\mathrm{{object}}^\mathrm{{space}}} \right) ^{ - 1}}. \end{aligned}$$
(6.17)

Inserting Eq. (6.17) into Eq. (6.16), and noting that for short durations \({\mathbf {R}}_\mathrm{{object}}^\mathrm{{space}} \approx {\mathbf {R}}_\mathrm{{object, start}}^\mathrm{{space}}\) leads to

$$\begin{aligned} {\mathbf {R}}_\mathrm{{object,new}}^\mathrm{{space}} = {\mathbf {R}}_\mathrm{{object,start}}^\mathrm{{space}} \cdot \Delta {{\mathbf {R}}^\mathrm{{object}}} \cdot {\left( {{\mathbf {R}}_\mathrm{{object, start}}^\mathrm{{space}}} \right) ^{ - 1}} \cdot {\mathbf {R}}_\mathrm{{object,start}}^\mathrm{{space}} = {\mathbf {R}}_\mathrm{{object, start}}^\mathrm{{space}} \cdot \Delta {{\mathbf {R}}^\mathrm{{object}}}. \end{aligned}$$
(6.18)

Comparing this to Eq. (6.16), we see that for incremental rotations the only thing that changes as we switch from an angular movement recorded with respect to space to an angular movement recorded with respect to the object is the sequence of the matrix multiplication!

For practical calculations, it is easiest to determine the orientation from the angular velocity using quaternions, as has been shown in Sect. 5.3.2. There angular velocities were used that describe the angular movement with respect to space \({{\varvec{\upomega }} ^\mathrm{{space}}}\), and the final orientation was given by Eq. (5.25). Now if instead angular velocities are used that have been measured with respect to the object \({{\varvec{\upomega }}^\mathrm{{object}}}\), Eqs. (6.16) and (6.18) imply that the only thing that has to be changed is the sequence of rotations. Using quaternions, the final 3-D orientation of an object with respect to space whose orientation has been recorded with an IMU is, therefore, given by

$$\begin{aligned} \varvec{\tilde{q}}(t) = \varvec{\tilde{q}}(t_0) \circ \Delta \varvec{\tilde{q}}^\mathrm{{object}}(t_1) \circ \Delta \varvec{\tilde{q}}^\mathrm{{object}}(t_2) \circ ... \circ \Delta \varvec{\tilde{q}}^\mathrm{{object}}(t_{n - 1}) \circ \Delta \varvec{\tilde{q}}^\mathrm{{object}}(t_n)\,, \end{aligned}$$
(6.19)

where as in Eq. (5.25) the quaternion vectors are given by

$$\begin{aligned} \Delta \mathbf {q}^\mathrm{{object}}(t_i) = \mathbf {n}(t)\sin \left( \frac{{\Delta \phi ({t_i})}}{2} \right) = \frac{{{{\varvec{\upomega }}^\mathrm{{object}}}({t_i})}}{{\left| {{{\varvec{\upomega }}^\mathrm{{object}}}({t_i})} \right| }}\sin \left( {\frac{{\left| {{{\varvec{\upomega }}^\mathrm{{object}}}({t_i})} \right| \Delta t}}{2}} \right) \end{aligned}$$
(6.20)

with \(\varvec{\tilde{q}}(t_0)\) the starting quaternion, and \(\Delta \varvec{\tilde{q}}^\mathrm{{object}}(t_i)\) the quaternions corresponding to the vector parts \(\Delta \mathbf {q}^\mathrm{{object}}(t_i)\).

6.2.2 Position in Space

Initial Orientation

As mentioned in Sect. 6.2.2, accelerometers measure the gravito-inertial acceleration, not just the acceleration caused by the movement of the object in space. In order to obtain only the linear acceleration of an object in space from the signals of an acceleration sensor, one first has to subtract gravity from the measured acceleration signal. For that, the orientation with respect to gravity first has to be determined from the gyroscope signals (see Fig. 6.5).

Fig. 6.5
figure 5

Strapdown inertial navigation algorithm                

If one knows the initial position \(\mathbf {x}(t=0)\) and the initial velocity \(\frac{\mathrm{d}\mathbf {x}}{\mathrm{d}t}\Bigg \vert _{t = 0}\), one can integrate the acceleration signals to obtain velocity and position in space.

If the sensor is rotated, the acceleration component contributed by gravity points in a direction that depends on the orientation of the sensor coordinate system with respect to space. Note that a rotation of the sensor about gravity does not change the gravitational acceleration measured. In contrast, a tilt of the sensor with respect to gravity changes the output of the IMU accelerometer. The application example in Sect. 4.5.2 shows how to combine the knowledge about the approximate orientation of the sensor with the measured acceleration signal at \(t=0\), to obtain the best possible estimate of the initial sensor orientation.

Finding Acceleration, Velocity, and Position in Space

If the orientation of the sensor with respect to space is denoted by \(\mathbf {R}_\mathrm{{sensor}}^\mathrm{{space}}\), then the measured direction of gravity is

$$\begin{aligned} \mathbf g^\mathrm{{sensor}}&= {\left( {{\mathbf {R}}_\mathrm{{sensor}}^\mathrm{{space}}} \right) ^{ - 1}} \cdot \mathbf g^\mathrm{{space}}\end{aligned}$$
(6.21)
$$\begin{aligned} {\mathbf {R}}_\mathrm{{sensor}}^\mathrm{{space}} \cdot \mathbf g^\mathrm{{sensor}}&= \mathbf g^\mathrm{{space}} \end{aligned}$$
(6.22)

The movement of the sensor in space can be determined from Eq. (2.7). Seen from a space-fixed coordinate system

$$\begin{aligned} \mathbf {acc} _\mathrm{{measured}}^\mathrm{{space}} = {\mathbf {R}}_\mathrm{{sensor}}^\mathrm{{space}} \cdot \mathbf {acc} _\mathrm{{measured}}^\mathrm{{sensor}} \,, \end{aligned}$$
(6.23)

the linear acceleration caused by movement in space is

$$\begin{aligned} \mathbf {acc} _\mathrm{{movement}}^\mathrm{{space}} = {\mathbf {R}}_\mathrm{{sensor}}^\mathrm{{space}} \cdot \mathbf {acc} _\mathrm{{measured}}^\mathrm{{sensor}} - \mathbf {g}^\mathrm{{space}} \end{aligned}$$
(6.24)

In many applications, one is interested in the position of the sensor (and thus of the object under investigation) with respect to space. When the inertial acceleration with respect to space is known, the positional change from the initial position can be found through integration.

Note that in the equations above, \(\mathbf {acc} _\mathrm{{movement}}^\mathrm{{space}}\) is the acceleration component caused by the movement with respect to space (Eq. 6.24), not the acceleration indicated by the accelerometer!

6.3 Applications: Gait Analysis

A simple analysis of leg movements while walking on a treadmill can demonstrate application of the utilities provided with scikit-kinematics. To record the movement of the upper and lower leg while walking on a treadmill, two IMUs from XSens were strapped to the upper and lower leg, as indicated in Fig. 6.6.

Fig. 6.6
figure 6

Positioning of IMUs on the right leg during the movement recording

Fig. 6.7
figure 7

3-D orientation of the knee while walking on a treadmill. (The data still contain small drift artifacts, which may be due to sensor slippage on the leg.)

The following piece of code demonstrates how the orientation of the lower leg with respect to the upper leg can be calculated. Thereby, the approximate initial orientation of the IMUs is provided, since the magnetic field signals are not used for the analysis. This “knee-movement” is expressed with respect to the space-fixed coordinate system.

figure a

CodeC6_gait_analysis.py: Demonstration of a quick evaluation of knee movements while walking on a treadmill (Fig. 6.7).

figure b

6.4 Exercises

Exercise 6.1: An (Almost) Simple Rotation

Assume that the body-fixed coordinate system is such that the x-axis points forward, the y-axis to the left, and the z-axis up. Before the rotations, the space-fixed coordinate system and the body-fixed coordinate system coincide. Now two rotations are performed: the body-fixed IMU is read out at 100 Hz, and shows the angular velocities indicated in Fig. 6.8.

Try to answer the following questions:

  • How can angular orientation be calculated—in principle—from angular velocity?

  • If the cumulative rotation during the first second amounts to 45\(^\circ \), what are the unit vectors of the body-fixed coordinate system after 1 s?

  • If the rotation during the \(2^{nd}\) second amounts to 30\(^\circ \), what are the unit vectors of the body-fixed coordinate system after 2 s?

Exercise 6.2: Pendulum

Consider the signals measured by an IMU that is attached to a perfect pendulum, with a length l = 20 cm.

Try to answer the following questions:

  • What are position and orientation of the pendulum as a function of time, if the pendulum is released at \(t = \) 5 s, at a deflection of 5\(^\circ \)?

  • What are the corresponding values if the initial deflection is 70\(^\circ \)?

  • Which acceleration signals are recorded during the movement?

  • Which angular velocity signals are recorded during the movement?

  • Do the expected measurement signals meet your expectation?

The solution to the following exercise shows that it can be almost impossible to guess the spatial movement from the accelerometer data alone.

Fig. 6.8
figure 8

Rotation about the z- and the x-axis

Fig. 6.9
figure 9

IMU attached to a pendulum

figure c

Code: C6_examples_IMU.py: Example of working with data from IMU sensors (p. 149) (Fig. 6.9).