body_soil: Doxygen documentation

namespace soil_simulator

Functions

void UpdateBodySoil(SimOut *sim_out, std::vector<float> pos, std::vector<float> ori, Grid grid, Body *body, float tol)

This function moves the soil resting on the body following its movement.

In this function, the movement applied to the base of the soil column is calculated and the soil is moved to this new location. The original position of the soil column in the body frame is stored in the body_soil_pos_ member of the SimOut class.

It is difficult to track accurately each body wall. This is currently done by determining the most likely location considering the movement made, and moving the soil to this location if the vertical distance is lower than a cell height. If it is not, the nine neighbouring cells are investigated. If no neighbouring cell has a body wall located at a distance lower than a cell height, the soil is moved to the cell with the lowest vertical distance. Note that it may still potentially lead to an incorrect choice.

If no body wall is present, the soil is moved down to the terrain and a warning is issued as it should normally not happen.

The new positions of the soil resting on the body are collected into sim_out.body_soil_pos_ along with the required information using the body_soil struct.

Parameters:
  • sim_out – Class that stores simulation outputs.

  • pos – Cartesian coordinates of the body origin. [m]

  • ori – Orientation of the body. [Quaternion]

  • grid – Class that stores information related to the simulation grid.

  • body – Class that stores information related to the body object.

  • tol – Small number used to handle numerical approximation errors.