Skip to content

regression in Vizard communication #1371

@schaubh

Description

@schaubh

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:

  1. Build Basilisk with OpNav/Vizard support enabled.
  2. Launch an OpNav scenario that uses Vizard image requests in noDisplay mode, for example:
    python examples/OpNavScenarios/scenariosOpNav/scenario_OpNavOD.py
  3. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions