Skip to content

Commit

Permalink
Purge laptop battery and plugged in status code as the Pi does not ha…
Browse files Browse the repository at this point in the history
…ve a concept of this.
  • Loading branch information
chrisl8 committed Oct 7, 2024
1 parent d956ec7 commit cbf8ea2
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 182 deletions.
4 changes: 0 additions & 4 deletions arlobot_ros/msg/ArloSafety.msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
bool safe_to_go
bool safe_to_operate
bool unplugging
bool ac_power
int16 laptop_battery_percent
bool dangerous_doors_open
2 changes: 0 additions & 2 deletions arlobot_ros/msg/ArloStatus.msg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ bool left_motor_power
bool right_motor_power
float32 robot_battery_level
bool robot_battery_low
int16 laptop_battery_percent
bool ac_power
bool cliff
bool floor_obstacle
5 changes: 0 additions & 5 deletions arlobot_ros/propellerbot_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def __init__(self):
self._broadcast_static_odometry = False
self._leftMotorPower = False
self._rightMotorPower = False
self._laptop_battery_percent = 100
# Store last x, y and heading for reuse when we reset
# I took off the ~, because that was causing these to reset to default on every restart
# even if roscore was still up.
Expand Down Expand Up @@ -265,10 +264,6 @@ def _safety_shutdown(self, status):
self._SafeToOperate = status.safe_to_operate
self._safeToGo = status.safe_to_go

self._settings_from_ros["pluggedIn"] = status.ac_power

self._laptop_battery_percent = status.laptop_battery_percent

# noinspection Duplicates
def _propellerOdomDataHandler(self, data):
"""
Expand Down
4 changes: 0 additions & 4 deletions node/behaviors/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const webModelFunctions = require('../webModelFunctions');
const personalData = require('../personalData');
const robotModel = require('../robotModel');
const speechEngine = require('../speechEngine');
const checkBattery = require('../checkBattery');
const getQRcodes = require('../getQRcodes');
const saveScreenShotForWeb = require('../saveScreenShotForWeb');
const howManySecondsSince = require('../howManySecondsSince');
Expand Down Expand Up @@ -45,9 +44,6 @@ async function polling() {
// noinspection ES6MissingAwait
publishRobotURL.updateRobotURL();
}
if (intervalCount === 0) {
checkBattery();
}
if (intervalCount === intervalTop) {
if (!webModel.cameraOn) {
saveScreenShotForWeb();
Expand Down
1 change: 0 additions & 1 deletion node/behaviors/startROS.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ async function startROS() {
webModelFunctions.updateRosTopicItem('gyro_heading', 0.0);
webModelFunctions.updateRosTopicItem('left_motor_power', true);
webModelFunctions.updateRosTopicItem('right_motor_power', true);
webModelFunctions.updateRosTopicItem('laptopBatteryPercent', 85);
webModelFunctions.updateRosTopicItem('robot_battery_level', 12.6);
webModelFunctions.updateRosTopicItem('robot_battery_low', false);
}
Expand Down
131 changes: 0 additions & 131 deletions node/checkBattery.js

This file was deleted.

22 changes: 0 additions & 22 deletions node/speechModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,28 +212,6 @@ const speechModel = {
},
},
},
laptopFullyCharged: {
repeatInterval: 0,
spacing: 0,
true: {
thingsToSay: {
repeat: true,
charged: {
text: 'Computer battery fully charged!',
weight: 100,
},
},
},
false: {
thingsToSay: {
repeat: true,
unDone: {
text: 'Starting to get tired.',
weight: 100,
},
},
},
},
mostRecentArrival: {
repeatInterval: 0,
spacing: 0,
Expand Down
10 changes: 0 additions & 10 deletions node/webModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ module.exports = {
checkUsbRelayBank: true, // Always read once on load
haltRobot: false,
semaphoreFilesRead: false,
laptopFullyCharged: 'unknown',
laptopBatteryPercentage: '???',
logStreamerRunning: false,
shutdownRequested: false,
status: 'Arlo behavior is not running.',
Expand Down Expand Up @@ -164,14 +162,6 @@ module.exports = {
alertOn: false,
alertBtnClass: 'btn-danger',
},
{
rosName: 'laptop_battery_percent',
fancyName: 'Laptop Battery %',
status: '',
btnClass: '',
alertOn: false,
alertBtnClass: 'btn-danger',
},
{
rosName: 'robot_battery_level',
fancyName: 'Robot Battery Volts',
Expand Down
4 changes: 1 addition & 3 deletions node/webModelFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ const updateRosParameter = (key, value) => {
exports.updateRosParameter = updateRosParameter;

const updateRosTopicItem = (key, value) => {
if (key === 'robot_battery_level') {
value = value.toFixed(1);
} else if (key === 'heading' || key === 'gyro_heading') {
if (key === 'heading' || key === 'gyro_heading') {
value = value.toFixed(3);
}
const arrayIndex = webModel.rosTopicItems.findIndex((x) => x.rosName === key);
Expand Down

0 comments on commit cbf8ea2

Please sign in to comment.