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
int [] vals = dyio.getAllChannelValues(); | |
//Set up the array of channels | |
ArrayList<ServoChannel> chans = new ArrayList<ServoChannel>(); | |
Log.enableDebugPrint(); | |
float time = 5; | |
for(int i=0;i<12;i++){ | |
chans.add(new ServoChannel(dyio.getChannel(i))); | |
} | |
//Set the DyIO into cached mode | |
dyio.setCachedMode(true); |
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.dyio; | |
import java.io.File; | |
import com.neuronrobotics.sdk.dyio.DyIO; | |
import com.neuronrobotics.sdk.dyio.sequencer.CoreScheduler; | |
import com.neuronrobotics.sdk.ui.ConnectionDialog; | |
public class SchedulerTest { |
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.addons.driving.virtual.VirtualLineSensor; | |
import com.neuronrobotics.addons.driving.virtual.VirtualPuckBot; | |
import com.neuronrobotics.addons.driving.virtual.VirtualWorld; | |
import com.neuronrobotics.sdk.util.ThreadUtil; | |
public class VirtualLineTrack { | |
/** | |
* @param args |
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.net.InetAddress; | |
import java.net.UnknownHostException; | |
import com.neuronrobotics.sdk.common.BowlerAbstractDevice; | |
import com.neuronrobotics.sdk.common.BowlerDatagram; | |
import com.neuronrobotics.sdk.common.IBowlerDatagramListener; | |
import com.neuronrobotics.sdk.common.InvalidConnectionException; | |
import com.neuronrobotics.sdk.common.Log; |
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.Log; | |
import com.neuronrobotics.sdk.network.BowlerTCPClient; | |
import com.neuronrobotics.sdk.pid.GenericPIDDevice; | |
import com.neuronrobotics.sdk.pid.PIDChannel; | |
Log.enableDebugPrint(); |
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.dyio; | |
import com.neuronrobotics.sdk.dyio.DyIO; | |
import com.neuronrobotics.sdk.ui.ConnectionDialog; | |
public class SafeModeWatchDog { | |
/** | |
* @param args | |
*/ |
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
//Create a digital input object | |
DigitalInputChannel dig = new DigitalInputChannel(dyio.getChannel(8)); | |
//Loop forever printing out the state of the button | |
while(!Thread.interrupted()){ | |
System.out.println(dig.isHigh()); | |
Thread.sleep(1); | |
} |
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.education; | |
import com.neuronrobotics.pidsim.PIDConstantsDialog; | |
import com.neuronrobotics.pidsim.PIDSim; | |
public class PIDSimFullTest { | |
public static void main(String[] args) throws InterruptedException { | |
PIDSim pid = new PIDSim( .01, // mass | |
.5, //link length | |
5, //torque from static friction |
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
<root> | |
<link> | |
<name>basePan</name> | |
<type>virtual</type> | |
<index>0</index> | |
<scale>1</scale> | |
<upperLimit>180</upperLimit> | |
<lowerLimit>-180</lowerLimit> | |
<isLatch>true</isLatch> | |
<indexLatch>0</indexLatch> |
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
//If your DyIO is using a lower voltage power source, you need to disable the brownout detect | |
dyio.setServoPowerSafeMode(false); | |
ServoChannel srv = new ServoChannel (dyio.getChannel(0)); | |
//Loop 10 times setting the position of the servo | |
//the time the loop waits will be the time it takes for the servo to arrive | |
srv.SetPosition(0); | |
float time = 5; | |
System.out.println("Moving with time"); | |
for(int i = 0; i < 10&&!Thread.interrupted(); i++) { |