Closed tinmodeHuang closed 3 years ago
Hello there,
what code base is that based on? The current master and in which cases does this error occur? It seems like this is a segmentation fault, in which case there is most probably an access violation (e.g., on an object that has been deleted).
Best,
Patrick
EDIT: what kind of code are you executing?
the snippet below to determine the id of lane with agent in: agent.cpp
XodrLaneId Agent::GetCurrentLaneId() const {
auto lanecorridor = road_corridor_->GetCurrentLaneCorridor(GetCurrentPosition());
auto lane = lanecorridor->GetCurrentLane(GetCurrentPosition());
return lane->GetId();
}
agent.cpp
.def("GetDistance2RoadEdge", &Agent::GetDistance2RoadEdge)
I doubt that the function causes the problem when running tfa_gnn.py
What do you use the lane_id for? At first sight, this function seems to be correct.
I would recommend you to assert that the values are not null pointers, e.g., using BARK_EXPECT_TRUE(lanecorridor != nullptr);
Do you access anything with the retrieved lane_id? But in general debugging and setting assertions should help narrowing down the problem.
the answer to the first question is to determine Ids of lane with each agent in.
The function looks good on first sight, but as I cannot see the full code and how you are using it, you have to try to debug it by yourself. You can also attach the python process to the c++.
Have a look here: https://bark-simulator.readthedocs.io/en/latest/debugging.html#debugging-c-and-python
I tried to debug it but was blocked by the problem below, and it is a custom function
As I do not have access to any of your code, I cannot help you further at this point. I would suggest for you to add as many assertions as you can to figure out where exactly it fails.
all right
info printed as below:
thanks for any tips at advance