Skip to content

Commit

Permalink
updated to include ambi osc mode
Browse files Browse the repository at this point in the history
  • Loading branch information
maybites committed Feb 13, 2021
1 parent 632c119 commit 7403ea8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
Binary file modified NatNet2OSC.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Start_Client.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NatNet2OSC 192.168.2.2 54321 54322 239.255.42.99 8 1 0 0
NatNet2OSC 192.168.20.191 54321 54322 239.255.42.99 16 1 0 0
23 changes: 18 additions & 5 deletions _cpp-dev/NatNet2OSC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ class ExamplePacketListener : public osc::OscPacketListener {
int main(int argc, char* argv[])
{
if((argc < 2) || (argc > 5)){
printf("\nUsage: NatNet2OSC <OSCIP (localIP)> <OSCSendPort (54321)> <OSCCmndPort (54322)> <MultCast (castIP)> <oscMode (max=1, isadora=2, touch=4, sparck=8, max+touch=5, etc]> <UpAxis 0=same, 1=yUp to zUp> [verbose] [legacy]\n");
printf("\nUsage: NatNet2OSC <OSCIP (localIP)> <OSCSendPort (54321)> <OSCCmndPort (54322)> <MultCast (castIP)> <oscMode (max=1, isadora=2, touch=4, sparck=8, ambi=16, max+touch=5, etc]> <UpAxis 0=same, 1=yUp to zUp> [verbose] [legacy]\n");
}

printf("\n---- NatNet2OSC v. 8.0 ----");
printf("\n---- 20201207 by maybites ----\n\n");
printf("\n---- NatNet2OSC v. 8.2 ----");
printf("\n---- 20210213 by maybites ----\n\n");

int retval;
char szMyIPAddress[128] = "";
Expand Down Expand Up @@ -857,6 +857,7 @@ void Unpack(char* pData)
if (OSCType & 8) { // for sparck
p << osc::BeginMessage("/rb");
p << ID;
p << 2;
p << timestamp;
p << pxt;
p << pyt;
Expand All @@ -867,6 +868,15 @@ void Unpack(char* pData)
p << qwt;
p << osc::EndMessage;
}
if (OSCType & 16) {
sprintf(ns, "/icst/ambi/sourceindex/xyz");
p << osc::BeginMessage(ns);
p << ID;
p << pxt;
p << pyt;
p << pzt;
p << osc::EndMessage;
}


// associated marker positions
Expand Down Expand Up @@ -948,8 +958,9 @@ void Unpack(char* pData)
p << osc::EndMessage;
}
if (OSCType & 8) {
p << osc::BeginMessage("/rb/mk");
p << osc::BeginMessage("/rb");
p << ID;
p << 1;
p << k;
p << pxt;
p << pyt;
Expand Down Expand Up @@ -1015,8 +1026,9 @@ void Unpack(char* pData)
p << osc::EndMessage;
}
if (OSCType & 8) {
p << osc::BeginMessage("/rb/mk");
p << osc::BeginMessage("/rb");
p << ID;
p << 1;
p << k;
p << pxt;
p << pyt;
Expand Down Expand Up @@ -1166,6 +1178,7 @@ void Unpack(char* pData)
if (OSCType & 8) { // for sparck
p << osc::BeginMessage("/skel");
p << skeletonID;
p << 10;
p << ID;
p << timestamp;
p << pxt;
Expand Down
17 changes: 11 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NatNet2OSC
NatNet2OSC 8.2
===================================


Expand Down Expand Up @@ -71,10 +71,13 @@ TouchDesigner: OSC MODE = 4

SPARCK: OSC MODE = 8

+ /rb \<rigidbodyID> \<timestamp> \<x> \<y> \<z> \<qx> \<qy> \<qz> \<qw>
+ /rb/mk \<rigidbodyID> \<markerId> \<x> \<y> \<z>
+ /skel \<skleletonID> \<boneID> \<timestamp> \<x> \<y> \<z> \<qx> \<qy> \<qz> \<qw>
+ /f/e \<frameNumber>
+ /rb \<rigidbodyID> \<datatype = 1> \<markerId> \<x> \<y> \<z>
+ /rb \<rigidbodyID> \<datatype = 2> \<timestamp> \<x> \<y> \<z> \<qx> \<qy> \<qz> \<qw>
+ /skel \<skleletonID> \<datatype = 10> \<boneID> \<timestamp> \<x> \<y> \<z> \<qx> \<qy> \<qz> \<qw>

AMBI: OSC MODE = 16

+ /icst/ambi/sourceindex/xyz \<rigidbodyID> \<x> \<y> \<z>

IF you want to have multiple modes, set the oscmode for "max and isadora (1+2)" to 3 or "isadora and touch (2+4)" to 6

Expand All @@ -83,6 +86,7 @@ At the end of the frame the frameend message is sent
+ /frame/end \<frameNumber>

in case of SPARCK: OSC MODE = 8

+ /f/e \<frameNumber>

### Remote control
Expand All @@ -95,10 +99,11 @@ the following commands are implemented:

will return all rigidbodies and skeletons currently streaming

+ /motive/update/start
+ /motive/rigidbody/id \<rigidbodyName> \<rigidbodyID>
+ /motive/skeleton/id \<skleletonName> \<SkeletonID>
+ /motive/skeleton/id/bone \<skleletonName> \<boneID> \<boneName>

+ /motive/update/end

Building
---------
Expand Down

0 comments on commit 7403ea8

Please sign in to comment.