Skip to content

Commit

Permalink
Added a slightly different home position called "running" which allow…
Browse files Browse the repository at this point in the history
…s us to use the camera. Might be useful in some circumstances, could probably remove if we have sliders working since it's really only one servo different to the home positon.
  • Loading branch information
WilliamsJack committed Jun 23, 2021
1 parent 1c4bf03 commit 39a4d8d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions interface/js/sights.control.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ $(document).on("ready", function () {
createFunctionKeyBind(['k'], "PADDLE_REVERSE");
createFunctionKeyBind(['h'], "HOME");
createFunctionKeyBind(['m'], "MAPPING");
createFunctionKeyBind(['r'], "RUNNING");

// Disable keyboard controls when modal is open
$(".modal").on('shown.bs.modal', function () {
Expand Down
25 changes: 19 additions & 6 deletions src/control_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,30 @@ def keyboard_handler(self, control, value):
self.logger.info("GOING HOME: 5")
elif control == "MAPPING":
if value == "DOWN":
self.logger.info("GOING EXPLORING")
self.logger.info("GOING MAPPING")
self.servos.go_to_pos(int(self.config["arm"]["elbow"]), 4800)
self.logger.info("GOING EXPLORING: 1")
self.logger.info("GOING MAPPING: 1")
self.servos.go_to_pos(int(self.config["arm"]["wrist"]), 3724)
self.logger.info("GOING EXPLORING: 2")
self.logger.info("GOING MAPPING: 2")
self.servos.go_to_pos(int(self.config["arm"]["shoulder"]), 5960)
self.logger.info("GOING EXPLORING: 3")
self.logger.info("GOING MAPPING: 3")
self.servos.go_to_pos(int(self.config["arm"]["elbow"]), 3820)
self.logger.info("GOING EXPLORING: 4")
self.logger.info("GOING MAPPING: 4")
self.servos.go_to_pos(int(self.config["arm"]["gripper"]), 4112)
self.logger.info("GOING MAPPING: 5")
elif control == "RUNNING":
if value == "DOWN":
self.logger.info("GOING EXPLORING")
self.servos.go_to_pos(int(self.config["arm"]["elbow"]), 4800)
self.logger.info("GOING EXPLORING (but with the camera and without mapping): 1")
self.servos.go_to_pos(int(self.config["arm"]["wrist"]), 5600)
self.logger.info("GOING EXPLORING (but with the camera and without mapping): 2")
self.servos.go_to_pos(int(self.config["arm"]["shoulder"]), 3712)
self.logger.info("GOING EXPLORING (but with the camera and without mapping): 3")
self.servos.go_to_pos(int(self.config["arm"]["elbow"]), 3776)
self.logger.info("GOING EXPLORING (but with the camera and without mapping): 4")
self.servos.go_to_pos(int(self.config["arm"]["gripper"]), 4112)
self.logger.info("GOING EXPLORING: 5")
self.logger.info("GOING EXPLORING (but with the camera and without mapping): 5")

def message_handler(self, buf):
# Load object from JSON
Expand Down

0 comments on commit 39a4d8d

Please sign in to comment.