ZJU-FAST-Lab / EGO-Planner-v2

Swarm Playground, the codebase of the paper "Swarm of micro flying robots in the wild"
GNU General Public License v3.0
400 stars 71 forks source link

Why is multi-threaded spinner not used? #13

Closed shubham-shahh closed 1 year ago

shubham-shahh commented 2 years ago

Hi @bigsuperZZZX, I am using the planner with point cloud data and I get this error again and again [traj_server] Lost heartbeat from the planner, is it dead?

to get around this error, I used a multi-threaded spinner, which lead to the following error A negtive value of nearby obstacle number! reset the map.

can you point out possible solutions to tackle the problem of heartbeat?

shubham-shahh commented 2 years ago

Hi @bigsuperZZZX , Any update on this?

bigsuperZZZX commented 2 years ago

Please do NOT use a multi-threaded spinner, it will cause many unexpected problems.

shubham-shahh commented 2 years ago

Please do NOT use a multi-threaded spinner, it will cause many unexpected problems.

Yes, i have encountered them, mostly i noticed a lot of segmentation faults in optimization section. but callbacks such as fading callback and cloud callback ( In my case I'm using a point cloud) take a lot of time to execute changeinBuf function which reduces the rate at which the FSM timed callback is running

Can you point out potential solutions to overcome this problem

Thanks

shubham-shahh commented 1 year ago

Hi @bigsuperZZZX, any update on this?

bigsuperZZZX commented 1 year ago

It requires a lot of mutexes and seems to be a big project.

shubham-shahh commented 1 year ago

For a single drone executions, what all places would need mutex? I think a mutex between fading callback and the update cloud callback

And in the plan manager, for state machine callback and check collision callback, please correct me if i am wrong and please add if more mutexes are needed

Thanks

bigsuperZZZX commented 1 year ago

It also requires a mutex between the planning callback and the mapping thread.

shubham-shahh commented 1 year ago

It also requires a mutex between the planning callback and the mapping thread.

I see, if I understand correctly, the getInflateOccupancy() and the changeIngBuf() functions need to work in mutex such that, when the map is being updated, it cannot be accessed by the planner and vice versa.

please correct me if I am wrong and please add if more precautions are needed

bigsuperZZZX commented 1 year ago

That's true.

shubham-shahh commented 1 year ago

That's true.

for a swarm configuration, do I need to run RecvBroadcastMINCOTrajCallback() in mutex with any other function?

bigsuperZZZX commented 1 year ago

Yes, when computing a new trajectory, the buffer storing others' trajectories should not be changed.

shubham-shahh commented 1 year ago

Yes, when computing a new trajectory, the buffer storing others' trajectories should not be changed.

got it, that makes sense, I'll look into it thanks once again for the help. I'll close this for now, and post if I have any updates

thanks