Skip to content

Commit

Permalink
add gaussian_noise to Statics::solve and default to 0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Oct 19, 2023
1 parent 0afa9df commit 12abb15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion gtdynamics/statics/Statics.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ class Statics : public Kinematics {
* @param slice Slice instance.
* @param robot Robot specification from URDF/SDF.
* @param configuration A known kinematics configuration.
* @param gaussian_noise noise (stddev) added to initial values (default 0.0).
*/
gtsam::Values solve(const Slice& slice, const Robot& robot,
const gtsam::Values& configuration) const;
const gtsam::Values& configuration,
double gaussian_noise = 0.0) const;

/**
* Solve for wrenches and kinematics configuration.
Expand Down
5 changes: 3 additions & 2 deletions gtdynamics/statics/StaticsSlice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ gtsam::Values Statics::initialValues(const Slice& slice, const Robot& robot,
}

gtsam::Values Statics::solve(const Slice& slice, const Robot& robot,
const gtsam::Values& configuration) const {
const gtsam::Values& configuration,
double gaussian_noise) const {
auto graph = this->graph(slice, robot);
gtsam::Values initial_values;
initial_values.insert(initialValues(slice, robot));
initial_values.insert(initialValues(slice, robot, gaussian_noise));

// In this function we assume the kinematics is given, and we add priors to
// the graph to enforce this. Would be much nicer with constant expressions.
Expand Down

0 comments on commit 12abb15

Please sign in to comment.