Bounding box and force_array


#1

Hello,

I built example-2-contacts/src/main.c to understand the bounding box and force_array parameters.

From the image below, I press on the center of the Morph and the contact info is shown. The blue parameters make sense; the red ones don’t, that is, bounding box and force_array data appear unpopulated.

I would appreciate clarifications. I searched through documentation and couldn’t find an explanation.

Thanks,
Brad


#2

Hello Brad,

Thank you for contacting us. You can find more information about the parameters and the contact bitmask on our guide under the Contact Data section: http://guide.sensel.com/api/#contact-data and can be set using the senselSetContactsMask http://guide.sensel.com/sensel_h/index.html#//apple_ref/c/func/senselSetContactsMask.

With regards to the force array, you can check out example-3-forces. You can enable both contacts and forces by passing (FRAME_CONTENT_PRESSURE_MASK | FRAME_CONTENT_CONTACTS_MASK) into senselSetFrameContent http://guide.sensel.com/sensel_h/index.html#//apple_ref/c/func/senselSetFrameContent

Best,
-Alex


#3

Thanks for the assistance. I had been using example-3-forces but decided to dump my code and start again. I hope the image below helps to expose the issue. The only changes I made are in green.

In response to constant pressure from my fingertip, I still only get zeroes for the contact bounding box coordinates:

0.000000,0.000000,0.000000,-0.000000
0.000000,0.000000,0.000000,-0.000000
0.000000,0.000000,0.000000,-0.000000

There was a good stream of force data (“Total Force”) in response to my fingertip press but I then commented that out to make it easier to search for non-zero bounding box coordinates, of which there were none.

Once this contact issue is resolved, then I look forward to finally getting the force array (for each of N contacts) after I change the mask and, of course, the loop logic.

Thanks,
Brad


#4

Hello Brad,

To get contacts and forces with all the existing data plus bounding boxes, you should replace line 78 with these two calls:

senselSetFrameContent(handle, FRAME_CONTENT_PRESSURE_MASK | FRAME_CONTENT_CONTACTS_MASK);
senselSetContactsMask(handle, CONTACT_MASK_ELLIPSE | CONTACT_MASK_BOUNDING_BOX);

This will enable forces, contacts, basic contact data, ellipse contact data, and contact bounding box data.

-Alex


#5

That works nicely! Thanks!