ZeroMQ Remote API with getContactInfo() C++ Bug
Posted: 30 Oct 2023, 00:32
Take a look at this c++ code,
I get this error
The Capsule handle returns valid input (i.e. 60).
CoppeliaSim Edu, Version 4.5.1 (rev. 4) 64bit (serialization version 24). Ubuntu 18.04 LTS.
Code: Select all
#include <iostream>
#include <vector>
#include <tuple>
#include <chrono>
#include <thread>
#include "RemoteAPIClient.h"
using namespace std;
int main(int, char**)
{
RemoteAPIClient client;
auto sim = client.getObject().sim();
client.setStepping(true);
sim.startSimulation();
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
auto CapsuleHandle = sim.getObject("./Capsule");
auto data = sim.getContactInfo(0,CapsuleHandle,sim.handleflag_extended);
while( sim.getSimulationState() != 0 )
{
client.step();
}
return 0;
}
I get this error
Code: Select all
terminate called after throwing an instance of 'jsoncons::json_runtime_error<std::out_of_range, void>'
what(): Invalid array subscript
Aborted (core dumped)
CoppeliaSim Edu, Version 4.5.1 (rev. 4) 64bit (serialization version 24). Ubuntu 18.04 LTS.