Page 1 of 1

Confusion about sim.moveToPose

Posted: 22 Mar 2023, 09:09
by Beiguagua
Hello,
In c++, the argument of sim.moveToPose is as follow:

Code: Select all

std::tuple<std::vector<double>, double> sim::moveToPose(int64_t flags, std::vector<double> currentPose, std::vector<double> maxVel, std::vector<double> maxAccel, std::vector<double> maxJerk, std::vector<double> targetPose, std::string callback, std::optional<json> auxData, std::optional<std::vector<double>> metric, std::optional<double> timeStep)
I don't know what callback is. The type of callback is string. Shouldn't it be a function? Is it defined in a child script? But I found that in the example sendIkMovementSequence-simMoveToPose, this function is defined in python, so should it be defined in c++, and if so, how should this function be defined?
Thanks

Re: Confusion about sim.moveToPose

Posted: 24 Mar 2023, 15:05
by coppelia
Hello,

the sim.moveToPose API command has to be used from within a Lua script, in CoppeliaSim. From an external application you can however trigger such calls, e.g. via sim.callScriptFunction, a little bit in a similar way as is described here:

using blocking functions from an external application.

Cheers