Confusion about sim.moveToPose

Typically: "How do I... ", "How can I... " questions
Post Reply
Beiguagua
Posts: 24
Joined: 10 Feb 2023, 02:09

Confusion about sim.moveToPose

Post 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

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Confusion about sim.moveToPose

Post 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

Post Reply