Open AndreiCostinescu opened 1 year ago
@AndreiCostinescu Thanks for the report. As I've said in the other issue, I wasn't notified of this.
Interesting behavior, I haven't used relative names that much in CoppeliaSim.
I'll take a look at this when I have the time but you're free to propose a solution as well.
Cheers, Murilo
Bug description The
OP_AUTOMATIC
flag that is passed by default to the functionget_object_translation(const std::string& objectname, const std::string& relative_to_objectname, const OP_MODES& opmode)
_(and probably also theget_object_rotation
and other similar functions)_ does not work when the second argument is different that the one that was used when the first call to the function happened. BecauseOP_AUTOMATIC
starts anOP_STREAMING
operation relative to the first object name, when a different relative object is passed as the second argument, the function will convert the opMode toOP_BUFFER
, which breaks the functionality because there is no buffered value relative to the new object name.To Reproduce Attached is the code I used. issueReplicator.zip
In the main function, please comment line 66, to only run the opMode issue test. The output shows that there is an exception thrown the second time the
get_object_pose
is called (which internally callsget_object_translation
andget_object_rotation
).Expected behavior The expected output would be that the code does not throw an exception and also starts streaming data relative to the new relative object.
Environment: