BB.Test.MockSolver (bb v0.15.4)

Copy Markdown View Source

Mock IK solver for testing BB.Motion without real IK computations.

Configure behaviour via process dictionary:

  • :mock_solver_result - the result to return from solve/5

Examples

BB.Test.MockSolver.set_result({:ok, %{joint1: 0.5}, %{iterations: 5, residual: 0.001, reached: true}})
BB.Test.MockSolver.set_result({:error, %BB.Error.Kinematics.Unreachable{target_link: :tip, residual: 0.5}})

Summary

Functions

Get the last call arguments (for assertions).

Set the result that solve/5 will return.

Create an unreachable error for testing.

Functions

last_call()

Get the last call arguments (for assertions).

set_result(result)

Set the result that solve/5 will return.

unreachable_error(target_link, opts \\ [])

Create an unreachable error for testing.