Here’s a filled-out version you can paste into GitHub:
Describe the bug
OpNav scenarios that request camera images from Vizard in noDisplay mode fail immediately with a BasiliskError:
_bskLogging.BasiliskError: Vizard image request acknowledgement was not received.
This appears to be a regression introduced by commit 685b79717e03eed43b22f7762cbd797e3bf994ae ([#1362] Validate image buffer sizes before copying). That commit began checking the return value of a pre-existing zmq_recv() call at the start of VizInterface::requestImage(). On a ZMQ_REQ socket, that receive happens before REQUEST_IMAGE_* is sent, so it returns -1 because the socket is in the wrong send/receive state. The old code ignored that failed receive and continued.
To reproduce
Steps to reproduce the behavior:
- Build Basilisk with OpNav/Vizard support enabled.
- Launch an OpNav scenario that uses Vizard image requests in
noDisplay mode, for example:
python examples/OpNavScenarios/scenariosOpNav/scenario_OpNavOD.py
- Vizard launches, but Basilisk stops shortly after simulation start with:
_bskLogging.BasiliskError: Vizard image request acknowledgement was not received.
Expected behavior
The OpNav scenario should continue running and receive camera image buffers from Vizard, as it did before the image-buffer validation change.
Screenshots
Not applicable.
Desktop (please complete the following information):
- OS: macOS
- Version: [fill in]
- Python version: [fill in]
Additional context
The likely fix is to remove the stale pre-request receive at the beginning of VizInterface::requestImage():
char buffer[10];
zmq_recv(this->requester_socket, buffer, 10, 0);
The request-image exchange should begin by sending REQUEST_IMAGE_<cameraID>, then receiving the image length and image data frames. The validation added for those actual response frames should remain.
Here’s a filled-out version you can paste into GitHub:
Describe the bug
OpNav scenarios that request camera images from Vizard in
noDisplaymode fail immediately with aBasiliskError:This appears to be a regression introduced by commit
685b79717e03eed43b22f7762cbd797e3bf994ae([#1362] Validate image buffer sizes before copying). That commit began checking the return value of a pre-existingzmq_recv()call at the start ofVizInterface::requestImage(). On aZMQ_REQsocket, that receive happens beforeREQUEST_IMAGE_*is sent, so it returns-1because the socket is in the wrong send/receive state. The old code ignored that failed receive and continued.To reproduce
Steps to reproduce the behavior:
noDisplaymode, for example:Expected behavior
The OpNav scenario should continue running and receive camera image buffers from Vizard, as it did before the image-buffer validation change.
Screenshots
Not applicable.
Desktop (please complete the following information):
Additional context
The likely fix is to remove the stale pre-request receive at the beginning of
VizInterface::requestImage():The request-image exchange should begin by sending
REQUEST_IMAGE_<cameraID>, then receiving the image length and image data frames. The validation added for those actual response frames should remain.