TRAVE_unity is device operation interface for TRAVE.
TRAVE project is supported by MITOU foundation.
Unity package is supported. Download unity package from here and import it.
Set up communication parameters.
using UnityEngine;
using TRAVE;
public class SampleClass : MonoBehaviour
{
TRAVEDevice device = TRAVEDevice.GetDevice();
void Start()
{
//Make connection with TRAVE device if connection hasn't been made.
if(!device.isConnected)
{
device.ReConnectToDevice()
}
//Set up torque mode to 1.0
device.SetTorqueMode(1.0f);
//Apply changes to TRAVE device
device.Apply();
}
}
Device operation API.
Returns singleton instance of TRAVEDevice.
TRAVEDevice instance have to be initialized with this method.
- out: TRAVEDevice
Singleton instance of TRAVEDevice.
public class SampleClass
{
TRAVEDevice device = TRAVEDevice.GetDevice();
}
Reconnect to TRAVE device.
- out: bool
if a connection has been made.
Set motor to torque mode and enter torque. (Change will not be applied without execution of <TRAVEDevice>.Apply()
method)
- torque: float
- spdLimit: float,optional
Maximun value of speed. [default: 10.0f] - spdLimitLiftup: float,optional
Maximun value of liftup speed. [default: 10.0f]
Set motor to speed mode and enter speed. (Change will not be applied without execution of <TRAVEDevice>.Apply()
method)
- speed: float
- trqLimit: float,optional
Maximun value of torque.[default: 6.0f]
Apply changes to TRAVE hardware device.
This method cannot be call more than 5Hz.
- forceChange: bool,optional
If true, force application regardless of the transmission interval.[default: false]
- out: bool
If settings are successfully applied.
if the connection between PC and TRAVE device is made.
Current motor mode. Returns either "Torque Mode" or "Speed Mode".
Current torque of the motor.
Current speed of the motor.
Current position of the motor.
Current integration angle of the motor.
API for the force gauge.