Skip to content

Commit

Permalink
Added Slider control for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
cavallialexander committed Jun 24, 2021
1 parent 6c49224 commit 73e6090
Show file tree
Hide file tree
Showing 159 changed files with 270 additions and 102 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion configs/ACTIVE_CONFIG
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
example.json
servo_config.json
53 changes: 6 additions & 47 deletions configs/example.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,14 @@
"default_speed": 3
},
"motors": {
"type": "roboteq",
"type": "virtual",
"port": "/dev/serial/by-id/usb-Roboteq_Motor_Controller_SDC2XXX-if00",
"channels": {
"left": [
0
],
"right": [
1
]
}
},
"paddles": {
"type": "roboclaw",
"port": "/dev/serial/by-id/usb-03eb_USB_Roboclaw_Solo_30A-if00",
"address": 128,
"channels": {
"left": 0,
"right": 1
}
},
"servos": {
"type": "maestro",
"port": "/dev/serial/by-id/usb-Pololu_Corporation_Pololu_Mini_Maestro_18-Channel_USB_Servo_Controller_00009329-if00",
"address": 12,
"instances": {
"0": {
"speed": 0.17,
"neutral": 0
},
"1": {
"speed": 0.17,
"neutral": "0"
},
"2": {
"speed": 0.17,
"neutral": 0
},
"3": {
"speed": 0.17,
"neutral": 0
}
"baudrate": 1000000,
"ids": {
"left": [],
"right": []
}
},
"arm": {
"shoulder": "0",
"elbow": "1",
"wrist": "2",
"gripper": "3"
},
"interface": {
"notifications": {
"enabled": true,
Expand Down Expand Up @@ -167,4 +126,4 @@
"log_level": "info",
"print_messages": false
}
}
}
9 changes: 9 additions & 0 deletions configs/servo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"motors": {
"type": "virtual"
},
"paddles": {
"type": "roboclaw",
"port": "/dev/serial/by-id/usb-03eb_USB_Roboclaw_Solo_30A-if00",
"address": 128,
"channels": {
"left": 0,
"right": 1
}
},
"servos": {
"type": "maestro",
"instances": {
Expand Down
159 changes: 159 additions & 0 deletions configs/servo_config2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"network": {
"ip": "*"
},
"control": {
"default_speed": 3
},
"motors": {
"type": "virtual"
},
"paddles": {
"type": "roboclaw",
"port": "/dev/serial/by-id/usb-03eb_USB_Roboclaw_Solo_30A-if00",
"address": 128,
"channels": {
"left": 0,
"right": 1
}
},
"servos": {
"type": "maestro",
"instances": {
"0": {
"speed": 0.17,
"neutral": 0
},
"1": {
"speed": 0.17,
"neutral": "0"
},
"2": {
"speed": 0.17,
"neutral": 0
},
"3": {
"speed": 0.17,
"neutral": 0
}
}
},
"arm": {
"shoulder": "0",
"elbow": "1",
"wrist": "2",
"gripper": "3"
},
"interface": {
"notifications": {
"enabled": true,
"timeout": 7
},
"cameras": {
"front": {
"enabled": true,
"id": 1
},
"back": {
"enabled": false
},
"left": {
"enabled": false
},
"right": {
"enabled": false
}
},
"graphs": [
{
"uid": "cpu_temperature",
"type": "circle",
"enabled": true,
"location": "#left_view_sensors",
"title": "CPU Temp.",
"unit": "°C",
"unit_style": "font-size: 12px;"
},
{
"uid": "memory_usage",
"type": "circle",
"enabled": true,
"location": "#left_view_sensors",
"title": "RAM Usage",
"unit": " MB",
"unit_style": "font-size: 12px;"
},
{
"uid": "disk_usage",
"type": "circle",
"enabled": true,
"location": "#right_view_sensors",
"title": "Disk Usage",
"unit": " GB",
"unit_style": "font-size: 12px;"
},
{
"uid": "cpu_usage",
"type": "circle",
"enabled": true,
"location": "#right_view_sensors",
"title": "CPU Usage",
"unit": "%",
"unit_style": "font-size: 15px;"
},
{
"uid": "uptime",
"type": "uptime",
"enabled": true,
"location": "#textgroup_left",
"title": "Uptime"
}
],
"theme": {
"accent_colour": "#ff5a00"
}
},
"sensors": [
{
"enabled": true,
"type": "cpu_temp",
"name": "CPU Temperature",
"period": 1,
"display_on": [
"cpu_temperature"
]
},
{
"enabled": true,
"type": "memory",
"name": "RAM Usage",
"period": 1,
"display_on": [
"memory_usage"
]
},
{
"enabled": true,
"type": "cpu_usage",
"name": "CPU Usage",
"period": 1,
"display_on": [
"cpu_usage"
]
},
{
"enabled": true,
"type": "disk_usage",
"name": "Disk Usage",
"precision": 1,
"period": 60,
"display_on": [
"disk_usage"
]
}
],
"debug": {
"log_level": "debug",
"print_messages": true
}
}
Empty file modified docs/.nojekyll
100644 → 100755
Empty file.
Empty file modified docs/CNAME
100644 → 100755
Empty file.
Empty file modified docs/_sidebar.md
100644 → 100755
Empty file.
Empty file modified docs/assets/docsify.min.js
100644 → 100755
Empty file.
Empty file modified docs/assets/docsify.search.min.js
100644 → 100755
Empty file.
Empty file modified docs/assets/docsify.sights.js
100644 → 100755
Empty file.
Empty file modified docs/assets/docsify.themeable.dark.css
100644 → 100755
Empty file.
Empty file modified docs/assets/docsify.themeable.light.css
100644 → 100755
Empty file.
Empty file modified docs/assets/docsify.themeable.min.js
100644 → 100755
Empty file.
Empty file modified docs/assets/github.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/assets/interface-screenshot.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/assets/logo.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/assets/prism-bash.min.js
100644 → 100755
Empty file.
Empty file modified docs/assets/prism-json.min.js
100644 → 100755
Empty file.
Empty file modified docs/assets/prism-python.min.js
100644 → 100755
Empty file.
Empty file modified docs/assets/sights.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/assets/thingiverse.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/changelog.md
100644 → 100755
Empty file.
Empty file modified docs/config_schema.md
100644 → 100755
Empty file.
Empty file modified docs/dev_environment.md
100644 → 100755
Empty file.
Empty file modified docs/extending.md
100644 → 100755
Empty file.
Empty file modified docs/getting_started.md
100644 → 100755
Empty file.
Empty file modified docs/index.html
100644 → 100755
Empty file.
Empty file modified docs/introduction.md
100644 → 100755
Empty file.
Empty file modified docs/js_libraries.md
100644 → 100755
Empty file.
Empty file modified docs/manual_install.md
100644 → 100755
Empty file.
Empty file modified docs/network.md
100644 → 100755
Empty file.
Empty file modified interface/css/railscasts.css
100644 → 100755
Empty file.
Empty file modified interface/css/sights.dark.css
100644 → 100755
Empty file.
Empty file modified interface/css/sights.style.css
100644 → 100755
Empty file.
Empty file modified interface/gamepad/index.html
100644 → 100755
Empty file.
Empty file modified interface/images/demo_camera/set-0/camera_front.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-1/camera_back.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-1/camera_front.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-1/camera_left.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-1/camera_right.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-2/camera_back.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-2/camera_front.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-2/camera_left.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-2/camera_right.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-3/camera_back.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-3/camera_front.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-3/camera_left.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-3/camera_right.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-4/camera_back.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-4/camera_front.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-4/camera_left.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-4/camera_right.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-5/camera_back.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-5/camera_front.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-5/camera_left.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified interface/images/demo_camera/set-5/camera_right.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-6/camera_back.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-6/camera_front.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-6/camera_left.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-6/camera_right.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-7/camera_back.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-7/camera_front.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-7/camera_left.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-7/camera_right.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-8/camera_back.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-8/camera_front.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-8/camera_left.jpg
100644 → 100755
Empty file modified interface/images/demo_camera/set-8/camera_right.jpg
100644 → 100755
Empty file modified interface/images/logo.png
100644 → 100755
Empty file modified interface/images/overlay.png
100644 → 100755
Empty file modified interface/images/sights.svg
100644 → 100755
58 changes: 52 additions & 6 deletions interface/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -752,17 +752,63 @@ <h6 class="dropdown-header">Power options</h6>
</div>
</div>
</div>
<div class="row justify-content-md-center no-gutters" id="arm_control">
<div class="row justify-content-md-center" id="arm_control">
<div class="col-md-auto camera-container" id="arm_control_sliders">
<div>
<label for="slider1" class="form-label">Slider 1</label>
<input type="range" class="form-range" id="slider1" min="3000" max="9000" >
<input id="slider1_text"></input>
<button id="slider1_reset">HOME</button>
<div class="card">
<div class="card-header">
Arm Control
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="row">
<div class="col">
<label for="shoulder" class="form-label">Shoulder</label>
</div>
<div class="col-md-auto">
<input type="range" class="form-range" id="shoulder" min="3000" max="9000" value="6000">
<input type="number" id="shoulder_text" min="3000" max="9000" value="6000">
</div>
</div>
</li>
<li class="list-group-item">
<div class="row">
<div class="col">
<label for="elbow" class="form-label">Elbow</label>
</div>
<div class="col-md-auto">
<input type="range" class="form-range" id="elbow" min="3000" max="9000" value="6000">
<input type="number" id="elbow_text" min="3000" max="9000" value="6000">
</div>
</div>
</li>
<li class="list-group-item">
<div class="row">
<div class="col">
<label for="wrist" class="form-label">Wrist</label>
</div>
<div class="col-md-auto">
<input type="range" class="form-range" id="wrist" min="3000" max="9000" value="6000">
<input type="number" id="wrist_text" min="3000" max="9000" value="6000">
</div>
</div>
</li>
<li class="list-group-item">
<div class="row">
<div class="col">
<label for="gripper" class="form-label">Gripper</label>
</div>
<div class="col-md-auto">
<input type="range" class="form-range" id="gripper" min="3000" max="9000" value="6000">
<input type="number" id="gripper_text" min="3000" max="9000" value="6000">
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div style="height:100px"></div>

</body>

Expand Down
Empty file modified interface/js/graphs/circlegraph.js
100644 → 100755
Empty file.
Empty file modified interface/js/graphs/graph.js
100644 → 100755
Empty file.
Empty file modified interface/js/graphs/linegraph.js
100644 → 100755
Empty file.
Empty file modified interface/js/graphs/textbox.js
100644 → 100755
Empty file.
Empty file modified interface/js/graphs/thermalcamera.js
100644 → 100755
Empty file.
Empty file modified interface/js/graphs/uptime.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/Chart.bundle.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/bootoast-fa.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/bootstrap.bundle.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/bootstrap.bundle.min.js.map
100644 → 100755
Empty file.
Empty file modified interface/js/lib/fontawesome/fontawesome.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/fontawesome/solid.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/gamepad.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/highlight.pack.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/jquery.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/jquery.xmlrpc.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/js-yaml.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/jsoneditor.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/lib/keyboard.min.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.alert.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.arm.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.config.schema.js
100644 → 100755
Empty file.
29 changes: 23 additions & 6 deletions interface/js/sights.control.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/*
Created by the Semi Autonomous Rescue Team
Licensed under the GNU General Public License 3.0
Expand Down Expand Up @@ -72,11 +73,18 @@ function createFunctionKeyBind(keys, ctrl, func) {
});
}


//Slider input for arm
function sendSliderInput(e) {
document.getElementById(e.target.id+"_text").innerText = e.target.value;
let c_event = {type: "SLIDER", control:"ARM", id:e.target.id, value:e.target.value};
sliderHistory.push(e.target.value);
document.getElementById(e.target.id+"_text").value = e.target.value;
let c_event = {type: "SLIDER", control:e.target.id, value:e.target.value};
safeSend(c_event);
}

//number input for arm
function sendNumberInput(e) {
var id = e.target.id.replace("_text","");
document.getElementById(id).value = e.target.value;
let c_event = {type: "SLIDER", control:id, value:e.target.value};
safeSend(c_event);
}

Expand Down Expand Up @@ -135,9 +143,18 @@ function controlConnection() {
}

$(document).on("ready", function () {
$("#slider1").on("input", function(event) {
sendSliderInput(event);
const armJoints = ["shoulder", "elbow", "wrist", "gripper"];
armJoints.forEach(function (item, index) {
$("#"+item).on("input", function(event) {
sendSliderInput(event);
});
$("#"+item+"_text").on("change", function(event){
if (event.target.value < 3000) event.target.value = 3000;
if (event.target.value > 9000) event.target.value = 9000;
sendNumberInput(event);
});
});

controlConnection();

// Hide 'Controller Connected' indicator, until connected
Expand Down
Empty file modified interface/js/sights.demo.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.interface.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.sensors.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.ssh.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.supervisor.js
100644 → 100755
Empty file.
Empty file modified interface/js/sights.util.js
100644 → 100755
Empty file.
Empty file modified src/README.md
100644 → 100755
Empty file.
Empty file modified src/configs/apache/sights.conf
100644 → 100755
Empty file.
Empty file modified src/configs/motion/cameras/video0.conf
100644 → 100755
Empty file.
Empty file modified src/configs/motion/cameras/video1.conf
100644 → 100755
Empty file.
Empty file modified src/configs/motion/cameras/video2.conf
100644 → 100755
Empty file.
Empty file modified src/configs/motion/cameras/video3.conf
100644 → 100755
Empty file.
Empty file modified src/configs/motion/motion.conf
100644 → 100755
Empty file.
Empty file modified src/configs/sights/backup/.gitkeep
100644 → 100755
Empty file.
Empty file modified src/configs/sights/minimal.json
100644 → 100755
Empty file.
Empty file modified src/configs/supervisor/supervisord.conf
100644 → 100755
Empty file.
Empty file modified src/configs/systemd/supervisord
100644 → 100755
Empty file.
Loading

0 comments on commit 73e6090

Please sign in to comment.