Hey, I'm using the NX Meta SDK and i've implemented a plugin following along from the stub analytics plugin provided as a sample.
Based on the documentation, there are two ways to push metadata to the NX server, via 'pushMetadataPacket' or implementing your own 'pulMetadataPackets' function. The stub analytics plugin implements the pullMetadataPackets function, however I've chosen to use the pushMetadataPacket since I don't need to interact with the frame at all for the purposes of my plugin.
I'm able to push metadata successfully to the NX server and it appears on the overlay in the NX MetaVMS. The issue I'm having however, is I'm trying to implement an 'action' that can be triggered on a frame with its associated metadata. The documentation says - if your solution needs context actions, declare them in Plugin's manifest and implement function nx::sdk::analytics::Engine::executeAction().
I have implemented this function, and my particular action needs access to the attributes, which I believe are located by accessing the objectTrackInfo parameter - I've based this on what I get by printing the outputs of a working action in the stub analytics plugin in the SDK. My objectTrackInfo seems to not have anything on it though, am I wrong in assuming this is how I would go about getting the object metadata that is attached to that trackId?
Here is the code related to this that hopefully is helpful to diagnose my issue:
In my device_agent.cpp file I have this:
void DeviceAgent::pushObjectMetadata(int64_t timestamp, std::string typeId, nx::sdk::Uuid trackId, nx::sdk::analytics::Rect boundingBox, std::vector<nx::sdk::Ptr<nx::sdk::Attribute>> attributes, int duration)
nx::sdk::analytics::ObjectMetadata *objectMetadata =newnx::sdk::analytics::ObjectMetadata();
nx::sdk::analytics::ObjectMetadataPacket *objectMetadataPacket =newnx::sdk::analytics::ObjectMetadataPacket();
In my engine.cpp file I have this:
NX_PRINT << __func__
<<"\ntrackId: "<< trackId
<<"\ndeviceId: "<< deviceId
if (actionId == kViewProfileAction)
actionUrl = "some url I will construct based on the track info";
returnnx::sdk::error(nx::sdk::ErrorCode::invalidParams, "Unsupported actionId");
The executeAction function isn't currently doing anything, but when i print out the outputs of the track and bestShotObjectMetadata i get 0 in contrast to the stub analytics plugin which has a track.
Any ideas where I'm going wrong?
Please sign in to leave a comment.