Follow the steps in the parent repository to configure ASA before beginning these steps.
After installing the Unity Ros Hub configure the IP of your ROS computer in the Robotics setting tab.
Similar to the parent repo a menu can be summoned by raising your left hand. Uppon pressing the create anchor button the project will begin searching for the calibration QR code. Once found a frame will be drawn on the QR code. If this position is correct press the "Create Anchor" button. The resulting anchor ID will be printed on the console as long as the device is plugged into the computer. To find the anchor ID, go to the output log and searched for the term "saved" using ctrl+F.
Feed this anchor ID into the "Anchor ID" field of the ASA Script. Upon rebuilding the unity and ROS enviornments should be succesfully colocated.
- Open an instance of the TFManager script in the inspector (NOTE: There should only be one instance of this script in the project)
- Add a new subscriber to the subscriber list by clicking the + icon
- Make the "Name" field the name of the frame ID provided by the ROS message
- Make the "Game Object" field the object of the model to be moved (If a selector is used make this object a paerent of both the model and selector objects)
- Optional Make the "Selector" object a selector to be used for this object. After doing so check the "Selectable" box
The tracked object should now work automatically.
The VelocityTracker script can be used in order to invoke actions when an object stops moving. The "Scale" property adjusts the scale of the velocity vector drawn on the object. The "Thresh" property adjusts the theshold at which an object is considered stopped.
The + icon under the OnStop list can be used to add unity events to invoke when the object is stopped. By adding a script with public methods to an object you can call the methods via this invoke list.