An unofficial Java package for cross-platform serial communication with a Robotiq FT Sensor
The communication protocol (and basis for config.properties
) for using a FT Sensor can be found here.
- Windows 10 x64
- OSX 10.11.5 x64
- Run
SerialUtilities.java
to list available serial ports (sensor should be connected and seen here) - Update
comm_port
inconfig.properties
to the proper serial port (e.g.,COM3
for Windows,cu.usbserial-FTXU0M1B
for OSX) - Run
RobotiqFtMaster.java
for a 20 second burst of data printed to the console
public static void main(String[] args) {
Logger.info("Running simple RobotiqFT connection test");
RobotiqFtMaster robotiqFtMaster = new RobotiqFtMaster();
try {
robotiqFtMaster.connect();
int maxTime = 20;
Logger.info(String.format("Reading from sensor for %d seconds", maxTime));
long startTime = System.currentTimeMillis();
while ((System.currentTimeMillis() - startTime) < (maxTime * 1000)) {
try {
System.out.println(Arrays.toString(robotiqFtMaster.getCompleteMeasure()));
} catch (ModbusException e) {
Logger.error(e);
}
}
} catch (Exception e) {
Logger.error(e);
}
}