Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got both marionette and arm working. all that is left is some physics…
… tweaking
- Loading branch information
Showing
92 changed files
with
3,558 additions
and
163 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/MessagingUtilities/bin/Debug/Utilities.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/MessagingUtilities/bin/Debug/Utilities.pdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/MessagingUtilities/obj/Debug/Utilities.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/MessagingUtilities/obj/Debug/Utilities.pdb
Binary file not shown.
This file contains 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
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Debug/RoboNuiTest.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Debug/RoboNuiTest.pdb
Binary file not shown.
Binary file modified
BIN
+4.5 KB
(110%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Debug/RoboticNaturalUserInterface.exe
Binary file not shown.
Binary file modified
BIN
+14 KB
(110%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Debug/RoboticNaturalUserInterface.pdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Debug/Utilities.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Debug/Utilities.pdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboNuiTest.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboNuiTest.pdb
Binary file not shown.
Binary file modified
BIN
+12.5 KB
(150%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboticNaturalUserInterface.exe
Binary file not shown.
Binary file modified
BIN
+18 KB
(120%)
RoboticNaturalUserInterface/RoboNuiTest/bin/Release/RoboticNaturalUserInterface.pdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/obj/Debug/ResolveAssemblyReference.cache
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/obj/Debug/RoboNuiTest.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/obj/Debug/RoboNuiTest.pdb
Binary file not shown.
Binary file modified
BIN
+3.11 KB
(110%)
RoboticNaturalUserInterface/RoboNuiTest/obj/Release/ResolveAssemblyReference.cache
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
RoboticNaturalUserInterface/RoboNuiTest/obj/Release/RoboNuiTest.pdb
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
126 changes: 126 additions & 0 deletions
126
...turalUserInterface/RoboticNaturalUserInterface/RobotAdapter/MiniSSC-II/ServoController.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.IO.Ports; | ||
using System.IO; | ||
|
||
using log4net; | ||
|
||
// TODO Implement | ||
|
||
namespace RoboNui.RobotAdapter.MiniSSC2 | ||
{ | ||
/** | ||
* <summary> | ||
* Base class for communicating commands to an SSC-32 servo controller | ||
* </summary> | ||
* <remarks>Author: Jon Eisen (yanatan16@gmail.com)</remarks> | ||
*/ | ||
class MiniSSCIIServoController | ||
{ | ||
/** | ||
* <summary>Log for logging events in this class</summary> | ||
*/ | ||
private ILog log; | ||
|
||
/** | ||
* <summary> | ||
* Serial port this controller communicates on | ||
* </summary> | ||
*/ | ||
private SerialPort port; | ||
|
||
bool inactive; | ||
|
||
ICollection<uint> activeChannels; | ||
|
||
/** | ||
* <summary> | ||
* Constructor with port name and open the port. | ||
* Also initializes servo channels to center | ||
* </summary> | ||
* | ||
* <param name="portName">Name of the serial port</param> | ||
* <param name="channels">Channels to center on construction</param> | ||
*/ | ||
protected MiniSSCIIServoController(string portName, ICollection<uint> channels) | ||
{ | ||
log = LogManager.GetLogger(this.GetType()); | ||
log.Debug(this.ToString() + " constructed."); | ||
|
||
activeChannels = channels; | ||
try | ||
{ | ||
port = new SerialPort(portName); | ||
port.Open(); | ||
port.BaudRate = 9600; | ||
port.NewLine = string.Empty + Convert.ToChar(13); | ||
port.Handshake = System.IO.Ports.Handshake.None; | ||
port.BaseStream.Flush(); | ||
|
||
port.ReadTimeout = 1000; | ||
inactive = false; | ||
|
||
foreach (uint ch in channels) | ||
{ | ||
ServoMovementCommand smc = new ServoMovementCommand(ch, 128); | ||
sendCommand(smc); | ||
} | ||
log.Info("Initiating all servos to center."); | ||
} | ||
catch (IOException ex) | ||
{ | ||
log.Error("Could not open Servo Controller Port on " + portName, ex); | ||
inactive = true; | ||
} | ||
|
||
} | ||
|
||
/** | ||
* <summary> | ||
* Destructor of the class. | ||
* Closes the serial port. | ||
* </summary> | ||
*/ | ||
~MiniSSCIIServoController() | ||
{ | ||
if (activeChannels != null) | ||
{ | ||
foreach (uint ch in activeChannels) | ||
{ | ||
ServoMovementCommand smc = new ServoMovementCommand(ch, 128); | ||
sendCommand(smc); | ||
} | ||
} | ||
if (port != null) | ||
{ | ||
port.Close(); | ||
} | ||
} | ||
|
||
/** | ||
* <summary> | ||
* Send a command to the servo controller | ||
* </summary> | ||
* | ||
* <param name="com">Command to send</param> | ||
*/ | ||
protected void sendCommand(ServoMovementCommand com) | ||
{ | ||
string str = "Send Command 0x"; | ||
foreach (byte b in com.CommandString()) | ||
{ | ||
str += string.Format("{0:00x}", b); | ||
} | ||
log.Debug(str); | ||
|
||
if (!inactive) | ||
{ | ||
IEnumerable<byte> command = com.CommandString(); | ||
port.Write(command.ToArray(), 0, command.Count()); | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.