soil_evolution: Doxygen documentation

namespace soil_simulator

Functions

template<typename T>
void SoilEvolution(T *body, bool set_rng, bool random_trajectory, bool logging, bool check_outputs, bool write_outputs)

This function provides an example script to run the simulator.

This example script simulates either a bucket performing a simple digging scoop in the XZ plane following a parabolic trajectory, or a blade performing a soil pushing in the XZ plane following a slightly parabolic trajectory. There is an option to randomize the parabolic trajectory by selecting the initial position (x_i, z_i) of the body and the deepest point of the trajectory (x_min, z_min) within reasonable ranges.

Note that the parabolic trajectory assumes that the orientation of the bucket follows the gradient of the trajectory. While it may not be fully accurate, it provides a good approximation for testing the simulator. By contrast, the blade keeps the same orientation throughout the trajectory.

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

  • set_rng – Indicates whether the RNG seed is set or not.

  • random_trajectory – Indicates whether the default trajectory or a randomized one is used.

  • logging – Indicates whether logging information are provided.

  • check_outputs – Indicates whether to run simulation outputs check at every step.

  • write_outputs – Indicates whether the simulation outputs are written into files at every step.

std::tuple<std::vector<std::vector<float>>, std::vector<std::vector<float>>> CalcTrajectory(float x_i, float z_i, float x_min, float z_min, float origin_angle, int nn)

This function calculates a parabolic trajectory given the starting position (x_i, z_i) and the deepest position (x_min, z_min) of the trajectory.

Parameters:
  • x_i – X coordinate of the starting position of the trajectory. [m]

  • z_i – Z coordinate of the starting position of the trajectory. [m]

  • x_min – X coordinate of the deepest position of the trajectory. [m]

  • z_min – Z coordinate of the deepest position of the trajectory. [m]

  • origin_angle – Angle to the horizontal plane of the body in its reference pose. [rad]

  • nn – Number of increments in the trajectory.

Returns:

A tuple composed of a vector aggregating the position of the body with time in meter, and a vector aggregating the orientation of the body with time following the quaternion convention.