0

在我的模拟中,我不断遇到仅在运行时发生的错误,例如

terminate called after throwing an instance of 'std::logic_error'
  what():  Vector appears to be nearly zero.

abort: Failure at multibody/plant/implicit_stribeck_solver.cc:216 in SolveQuadraticForTheSmallestPositiveRoot(): condition 'Delta > 0' failed.

我希望能够记录这些问题发生的时间,以追踪导致这些错误的特定状态。我还希望能够记录不同的状态参数,例如我的不同身体的力和位置,我知道该怎么做。

在不同时间检查身体位置和状态的功能已记录在案,例如EvalPoseInWorld(). 我正在寻找的是用于输出此数据的某种故障触发器。我还希望能够real_time_factor在德雷克模拟器中记录可见,但不知道如何访问它。

作为参考,我正在运行我在这个 fork 中制作的一个示例:https ://github.com/joaqgira/drake

drake/您可以在with中运行示例bazel run examples/springboard:shape_collision

4

1 回答 1

0

查看Simulator::set_monitor了解如何向模拟器添加回调。回调可以记录“最后一次已知的好时间”,您可以从中猜测问题时间不久之后。

查看Simulator::get_actual_realtime_rate的速率。(请注意,可视化器不直接使用该方法; drake/tools/workspace/drake_visualizer/plugin/show_time.py 用于可视化器逻辑来计算实时因子。)

于 2020-03-09T14:01:02.760 回答