This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.neuronrobotics.sdk.dyio.DyIO; | |
import com.neuronrobotics.sdk.ui.ConnectionDialog; | |
System.out.println("Starting"); | |
DyIO dyio=new DyIO(); | |
if (!ConnectionDialog.getBowlerDevice(dyio)){ | |
System.err.println("Dialog failed"); | |
return; | |
} | |
dyio.ping(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.neuronrobotics.addons.driving; | |
import com.neuronrobotics.sdk.dyio.DyIO; | |
import com.neuronrobotics.sdk.dyio.DyIOChannelMode; | |
import com.neuronrobotics.sdk.dyio.dypid.DyPIDConfiguration; | |
import com.neuronrobotics.sdk.pid.IPIDEventListener; | |
import com.neuronrobotics.sdk.pid.PIDConfiguration; | |
import com.neuronrobotics.sdk.pid.PIDEvent; | |
import com.neuronrobotics.sdk.pid.PIDLimitEvent; | |
import com.neuronrobotics.sdk.ui.ConnectionDialog; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CounterInputTestAsync implements ICounterInputListener{ | |
//The Counter channel is a property of the class | |
private CounterInputChannel dip; | |
public CounterInputTestAsync(){ | |
//Instantiate a new Counter channel | |
//The second parameter tells the Counter channel that is it an asynchronous channel | |
dip = new CounterInputChannel(dyio.getChannel(23),true); | |
//Add this instance of the Tester class to the Counter channel | |
dip.addCounterInputListener(this); | |
//Run forever printing out Counter events |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.neuronrobotics.addons.driving; | |
import gnu.io.NRSerialPort; | |
import java.util.ArrayList; | |
import com.neuronrobotics.addons.driving.virtual.ObsticleType; | |
public class HokuyoTest implements ISensorListener { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.neuronrobotics.test.nrdk; | |
import com.neuronrobotics.sdk.common.BowlerAbstractCommand; | |
import com.neuronrobotics.sdk.common.BowlerDatagram; | |
import com.neuronrobotics.sdk.common.BowlerMethod; | |
import com.neuronrobotics.sdk.common.ByteList; | |
import com.neuronrobotics.sdk.common.Log; | |
import com.neuronrobotics.sdk.pid.GenericPIDDevice; | |
import com.neuronrobotics.sdk.ui.ConnectionDialog; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Instantiate a new counter input | |
CounterInputChannel enc=new CounterInputChannel(dyio.getChannel(23)); | |
//To reset the value of the encoder, simply set the channel value | |
enc.setValue(0); | |
while(!Thread.interrupted()){ | |
System.out.println(enc.getValue()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PPMReaderChannel ppm = new PPMReaderChannel(dyio.getChannel(23)); | |
int servoChan = 4; | |
new ServoChannel(dyio.getChannel(servoChan));//Sets up the output channel for PPM cross link | |
ppm.stopAllCrossLinks(); | |
int [] cross = ppm.getCrossLink(); | |
//cross[0]=PPMReaderChannel.NO_CROSSLINK;//shut off the cross link for a channel | |
cross[0]=servoChan;//link ppm signal 0 to DyIO channel servoChan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up the analog channel | |
AnalogInputChannel ana = new AnalogInputChannel(dyio.getChannel(12)); | |
//disable the async so we can read just this channel | |
ana.setAsync(false); | |
//Loop forever printing out the voltage on the pin | |
while(!Thread.interrupted()){ | |
System.out.println(ana.getVoltage()); | |
Thread.sleep(100); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.neuronrobotics.test.nrdk.network; | |
import java.io.IOException; | |
import com.neuronrobotics.sdk.common.Log; | |
import com.neuronrobotics.sdk.common.MACAddress; | |
import com.neuronrobotics.sdk.common.device.server.BowlerAbstractServer; | |
import com.neuronrobotics.sdk.network.BowlerUDPServer; | |
import com.neuronrobotics.sdk.util.ThreadUtil; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CounterOutputAsyncTest implements ICounterOutputListener { | |
CounterOutputChannel stepper; | |
public CounterOutputAsyncTest () { | |
//Instantiate a new counter input | |
stepper=new CounterOutputChannel(dyio.getChannel(21)); | |
stepper.addCounterOutputListener(this); | |
// Move 5 steps | |
stepper.SetPosition(10000, 30); | |
ThreadUtil.wait(30000); | |
stepper.SetPosition(0, 0); |
OlderNewer