我在理解这些代码行的某些部分时遇到麻烦:
fn_ = boost::bind(&CheckFeasibility, this, &world_, _1, _2, _3 );
if (robot_state_->setFromIK(arg1, arg2, arg3, arg4, arg5, fn_ ))
第一行中this
的目的是什么,何时以及如何确定并传递CheckFeasibility
的参数?
这里是CheckFeasibility
函数的样子(我省略了参数的数据类型):
bool CheckFeasibility(*world, *state, *grp, *values)
谢谢
boost::bind
为您提供了一个函数,该函数映射其参数以调用另一个函数,然后可选地添加它已经知道的一些函数。它现在是标准的一部分,因此您可以在cppreference中阅读更多内容。
boost::bind
用于bind