Skip to content

Commit

Permalink
Merge pull request #62 from MissouriMRDT/feature-rovecomm2
Browse files Browse the repository at this point in the history
Feature Rovecomm2 and Development
  • Loading branch information
skeltonn authored Jul 27, 2019
2 parents 81b96bb + bc1ac9f commit 310772b
Show file tree
Hide file tree
Showing 149 changed files with 4,401 additions and 2,491 deletions.
1 change: 0 additions & 1 deletion BaseStation_Software
Submodule BaseStation_Software deleted from 657aaa
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Windows.Data;

namespace RED.Addons
namespace Core.Addons
{
public class BoolToValueConverter<T> : IValueConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using RED.Contexts.Input.Controllers;
using Core.Contexts.Input.Controllers;

namespace RED.Configurations.Input.Controllers
namespace Core.Configurations.Input.Controllers
{
internal static class XboxControllerInputConfig
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
using RED.Contexts.Input;
using Core.Contexts.Input;

namespace RED.Configurations.Input
namespace Core.Configurations.Input
{
internal static class InputManagerConfig
public static class InputManagerConfig
{
internal static InputMappingsContext DefaultInputMappings = new InputMappingsContext(new[] {
new InputMappingContext("Tank Drive (Traditional)", "Xbox", "Drive", 30, new[] {
public static InputMappingsContext DefaultInputMappings = new InputMappingsContext(new[] {
new InputMappingContext("Tank Drive (Traditional)", "Xbox", "Drive", 100, new[] {
new InputChannelContext("JoyStick1Y", "WheelsLeft"){ Parabolic = true },
new InputChannelContext("JoyStick2Y", "WheelsRight"){ Parabolic = true },
new InputChannelContext("ButtonStartDebounced", "ModeCycle") }),
new InputMappingContext("Diagonal Drive", "FlightStick", "Drive", 30, new[] {
new InputMappingContext("Diagonal Drive", "FlightStick", "Drive", 100, new[] {
new InputChannelContext("X", "WheelsLeft"){ Parabolic = true },
new InputChannelContext("Y", "WheelsRight"){ Parabolic = true },
new InputChannelContext("Button7Debounced", "ModeCycle") }),
new InputMappingContext("Vector Drive", "FlightStick", "Drive", 30, new[] {
new InputMappingContext("Vector Drive", "FlightStick", "Drive", 100, new[] {
new InputChannelContext("X", "VectorX"),
new InputChannelContext("Y", "VectorY"),
new InputChannelContext("Button8", "ForwardBump"),
new InputChannelContext("Button10", "BackwardBump"),
new InputChannelContext("Slider0", "Throttle"),
new InputChannelContext("Button7Debounced", "ModeCycle") }),
new InputMappingContext("Arm (Traditional)", "Xbox", "Arm", 100, new[] {
new InputChannelContext("JoyStick1Y", "IKYIncrement"){ Parabolic = true },
new InputChannelContext("JoyStick1Y", "ElbowBend"){ Parabolic = true },
new InputChannelContext("JoyStick1Y", "ElbowBend"){},
new InputChannelContext("JoyStick1X", "IKXIncrement"){ Parabolic = true },
new InputChannelContext("JoyStick1X", "ElbowTwist"){ Parabolic = true },
new InputChannelContext("JoyStick1X", "ElbowTwist"){},
new InputChannelContext("JoyStick2Y", "IKPitchIncrement"){ Parabolic = true },
new InputChannelContext("JoyStick2Y", "WristBend"){ Parabolic = true},
new InputChannelContext("JoyStick2Y", "WristBend"){},
new InputChannelContext("JoyStick2X", "IKYawIncrement"){ Parabolic = true },
new InputChannelContext("JoyStick2X", "WristTwist"){ Parabolic = true },
new InputChannelContext("JoyStick2X", "WristTwist"){},
new InputChannelContext("ButtonDPadUDebounced", "UseOpenLoop"),
new InputChannelContext("ButtonDPadDDebounced", "UseAngular"),
new InputChannelContext("ButtonDPadRDebounced", "UseRoverPerspectiveIK"),
new InputChannelContext("ButtonDPadLDebounced", "UseWristPerspectiveIK"),
new InputChannelContext("ButtonY", "NipperClose"),
new InputChannelContext("ButtonA", "NipperOpen"),
new InputChannelContext("ButtonY", "Nipper"),
new InputChannelContext("LeftTrigger", "IKZMagnitude"),
new InputChannelContext("LeftTrigger", "BaseBendMagnitude"),
new InputChannelContext("RightTrigger", "BaseBendMagnitude"),
new InputChannelContext("RightTrigger", "IKRollMagnitude"),
new InputChannelContext("RightTrigger", "BaseTwistMagnitude"),
new InputChannelContext("LeftTrigger", "BaseTwistMagnitude"),
new InputChannelContext("ButtonRb", "IKRollDirection"),
new InputChannelContext("ButtonRb", "BaseTwistDirection"),
new InputChannelContext("ButtonLb", "BaseTwistDirection"),
new InputChannelContext("ButtonLb", "IKZDirection"),
new InputChannelContext("ButtonLb", "BaseBendDirection"),
new InputChannelContext("ButtonRb", "BaseBendDirection"),
new InputChannelContext("ButtonB", "GripperOpen"),
new InputChannelContext("ButtonX", "GripperClose"),
new InputChannelContext("ButtonA", "SwitchTool"),
new InputChannelContext("ButtonBackDebounced", "GripperSwap"),
new InputChannelContext("ButtonStartDebounced", "ModeCycle") }),
new InputChannelContext("ButtonStartDebounced", "LaserToggle") }),

new InputMappingContext("Xbox Science Controls", "Xbox", "ScienceControls", 100, new[] {
new InputChannelContext("JoyStick1Y", "Screw"){ Parabolic = true },
new InputChannelContext("JoyStick2Y", "Drill"){ Parabolic = true },
new InputChannelContext("DPadL", "GenevaLeft"){ Parabolic = true },
new InputChannelContext("DPadR", "GenevaRight"){ Parabolic = true },
new InputChannelContext("DPadU", "OpenLoop"){ Parabolic = true },
new InputChannelContext("DPadD", "ClosedLoop"){ Parabolic = true },
new InputChannelContext("JoyStick2X", "XActuation"){ Parabolic = true },
new InputChannelContext("JoyStick2Y", "YActuation"){ Parabolic = true },
new InputChannelContext("DPadU", "ScrewPosUp"),
new InputChannelContext("DPadD", "ScrewPosDown"),
new InputChannelContext("ButtonStartDebounced", "ModeCycle") }),
new InputMappingContext("Xbox Gimbal", "Xbox", "Gimbal", 100, new[] {
new InputChannelContext("JoyStick1X", "Pan"){ Parabolic = true },
Expand All @@ -61,21 +63,21 @@ internal static class InputManagerConfig
new InputChannelContext("JoyStick2X", "Roll"){ Parabolic = true },
new InputChannelContext("JoyStick2Y", "Zoom"){ Parabolic = true },
new InputChannelContext("DPadU", "MainGimbalSwitch"){ Parabolic = true },
new InputChannelContext("DPadD", "SubGimbalSwitch"){ Parabolic = true },
new InputChannelContext("DPadD", "DriveGimbalSwitch"){ Parabolic = true },
new InputChannelContext("ButtonStartDebounced", "ModeCycle") }),
new InputMappingContext("Key Drive", "Keyboard", "Drive", 30, new[] {
new InputMappingContext("Key Drive", "Keyboard", "Drive", 100, new[] {
new InputChannelContext("WS", "WheelsLeft"),
new InputChannelContext("IK", "WheelsRight"),
new InputChannelContext("RDebounced", "ModeCycle") }),
new InputMappingContext("Key Gimbal", "Keyboard", "Gimbal", 30, new[] {
new InputMappingContext("Key Gimbal", "Keyboard", "Gimbal", 100, new[] {
new InputChannelContext("AD", "Pan"),
new InputChannelContext("WS", "Tilt"),
new InputChannelContext("I", "ZoomIn"),
new InputChannelContext("K", "ZoomOut"),
new InputChannelContext("RDebounced", "ModeCycle") }),
});

internal static InputSelectionsContext DefaultInputSelections = new InputSelectionsContext(new[] {
public static InputSelectionsContext DefaultInputSelections = new InputSelectionsContext(new[] {
new InputSelectionContext("Drive", "Xbox 1", "Tank Drive (Traditional)", true),
new InputSelectionContext("Arm", "Xbox 1", "Arm (Traditional)", false),
new InputSelectionContext("Main Gimbal", "Xbox 1", "Xbox Gimbal",false),
Expand Down
125 changes: 124 additions & 1 deletion Core/Configurations/MetadataManagerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Core.Configurations
{
public static class MetadataManagerConfig
{
public static MetadataSaveContext DefaultMetadata = new MetadataSaveContext(new[] {
internal static MetadataSaveContext RovecommOneMetadata = new MetadataSaveContext(new[] {
new MetadataServerContext("Drive Board", "192.168.1.130") {
Commands = new[] {
new MetadataRecordContext(528, "DriveLeftRight", "Left wheels speed followed by right wheels speed"),
Expand Down Expand Up @@ -185,5 +185,128 @@ public static class MetadataManagerConfig
}
},
});





internal static MetadataSaveContext RovecommTwoMetadata = new MetadataSaveContext(new[] {
new MetadataServerContext("Drive Board", "192.168.1.134") {
Commands = new[] {
new MetadataRecordContext(1000, "DriveLeftRight", "Left wheels speed followed by right wheels speed"),
new MetadataRecordContext(1001, "SpeedRamp", "Controls the accleration limit, ms to full speed"),
},
Telemetry = new[]
{
new MetadataRecordContext(1100, "DriveWatchdogTriggered", "")
}
},
new MetadataServerContext("Arm Board", "192.168.1.131") {
Commands = new[]
{
new MetadataRecordContext(8000, "ArmToAngle", "All values for the arm together. Armj1-j6."),
new MetadataRecordContext(8002, "IKRoverIncrement", "Incremental values for rover ik."),
new MetadataRecordContext(8003, "IKGripperIncrement", "Incremental values for gripper ik."),
new MetadataRecordContext(8004, "ArmValues", "All values for the arm together. Armj1-j6, then primary then secondary gripper."),
new MetadataRecordContext(8007, "ArmCommands", "Swap Gripper, Get Position 0, 1"),
new MetadataRecordContext(8013, "ToolSelection", "Change the selected tool, 0 1 & 2"),
new MetadataRecordContext(8014, "Laser", "Toggle the laser"),
new MetadataRecordContext(8015, "LimitSwitchOverride", "Toggle the laser")

},
Telemetry = new[]
{
new MetadataRecordContext(8101, "ArmAngles", "Angles for the arm joints")
}
},

new MetadataServerContext("BMS Board", "192.168.1.133") {
Commands = new[] {
new MetadataRecordContext(2000, "BMSStop", "BMS E-stop. WARNING: Kills all rover power. Cannot be reversed remotely!")
},
Telemetry = new[] {
new MetadataRecordContext(2101, "BMSVoltages", "BMS"),
new MetadataRecordContext(2100, "TotalPackCurrentInt", "BMS"),
new MetadataRecordContext(2102, "BMSTemperatureInt", "BMS"),
new MetadataRecordContext(2103, "BMSError", "BMS")
}
},

new MetadataServerContext("Power Board", "192.168.1.132") {
Commands = new[] {
new MetadataRecordContext(3000, "PowerBusEnableDisable", "Enables or Disables power bus"),
},
Telemetry = new[] {
new MetadataRecordContext(3100, "PowerCurrents", "Powerboard"),
new MetadataRecordContext(3101, "PowerBusStatus", "")
}
},
new MetadataServerContext("NavCamera Board", "192.168.1.136") {
Commands = new[]
{
new MetadataRecordContext(5000, "CalibrateIMU", "")
},
Telemetry = new[] {
new MetadataRecordContext(5100, "GPSPosition", "GPS Position. Latitude followed by Longitude"),
new MetadataRecordContext(5101, "PitchHeadingRoll", ""),
new MetadataRecordContext(5102, "Lidar", ""),
new MetadataRecordContext(5103, "GPSTelem", ""),
//new MetadataRecordContext(1296, "GPSQuality", "Quality of GPS signal"),
//new MetadataRecordContext(1298, "GPSSpeed", "Speed of GPS delta"),
//new MetadataRecordContext(1299, "GPSSpeedAngle", "Angle of GPS delta in degrees"),
//new MetadataRecordContext(1300, "GPSAltitude", "GPS Altitude"),
//new MetadataRecordContext(1301, "GPSSatellites", "Number of GPS Satellites"),

new MetadataRecordContext(4000, "CameraMuxChannel1", "Selection for Camera Mux Channel"),
}
},
new MetadataServerContext("Gimbal Board", "192.168.1.135") {
Commands = new[] {
new MetadataRecordContext(6002, "MainGimbalIncrement", "pan, tilt"),
new MetadataRecordContext(6004, "DriveGimbalIncrement", "pan, tilt")
}
},
new MetadataServerContext("ScienceSensors Board", "192.168.1.138") {
Commands = new[] {
new MetadataRecordContext(10000, "RunSpectrometer", "Sends command to begin the spectrometer sequence."),
new MetadataRecordContext(10001, "UVLedControl", "Control of light source."),
},
Telemetry = new[] {
new MetadataRecordContext(10100, "ScienceSensors", "Sensor data [AirT, AirM, SoilT, SoilM, Methane]"),
}
},
new MetadataServerContext("ScienceAcutation Board", "192.168.1.137") {
Commands = new[] {
new MetadataRecordContext(9000, "Screw", "-1000 to 1000 open loop for screw control"),
new MetadataRecordContext(9001, "ScrewAbsoluteSetPosition", ""),
new MetadataRecordContext(9002, "ScrewRelativeSetPosition", ""),
new MetadataRecordContext(9002, "XYActuation", "[x][y]"),
new MetadataRecordContext(9004, "CenterX", "")
},
Telemetry = new[]
{
new MetadataRecordContext(9100, "ScrewAtPos", "byte"),
}
},
new MetadataServerContext("Autonomy Board", "192.168.1.139") {
Commands = new[] {
new MetadataRecordContext(11100, "AutonomousModeEnable", ""),
new MetadataRecordContext(11101, "AutonomousModeDisable", ""),
new MetadataRecordContext(11102, "WaypointAdd", ""),
new MetadataRecordContext(11103, "WaypointsClearAll", ""),
new MetadataRecordContext(11104, "AutonomyCalibrate", "")
},
Telemetry = new[] {
new MetadataRecordContext(2580, "WaypointReached", "")
}
},
new MetadataServerContext("Lighting Board", "192.168.1.142") {
Commands = new[] {
new MetadataRecordContext(7000, "Headlights", "Headlights for the front of rover"),
new MetadataRecordContext(7001, "UnderglowColor", "rgb byte[]"),
new MetadataRecordContext(7002, "CycleLightingMode", "byte mode")
}
},
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Core.Contexts;

namespace RED.Contexts.Input.Controllers
namespace Core.Contexts.Input.Controllers
{
public class XboxControllerSettingsContext : ConfigurationFile
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Xml.Serialization;
using Core.Contexts;

namespace RED.Contexts.Input
namespace Core.Contexts.Input
{
[XmlType(TypeName = "InputMappings")]
public class InputMappingsContext : ConfigurationFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Xml.Serialization;
using Core.Contexts;

namespace RED.Contexts.Input
namespace Core.Contexts.Input
{
[XmlType(TypeName = "InputSelectionData")]
public class InputSelectionsContext : ConfigurationFile
Expand Down
Loading

0 comments on commit 310772b

Please sign in to comment.