Skip to content

Commit

Permalink
RC: change default motor and base power/speed values (viamrobotics#1657)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebriskin authored Dec 12, 2022
1 parent 2fbba1b commit 61dc278
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion web/frontend/src/components/base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const direction = ref<Directions>('Forwards');
const spinType = ref<SpinTypes>('Clockwise');
const increment = ref(1000);
// straight mm/s
const speed = ref(200);
const speed = ref(300);
// deg/s
const spinSpeed = ref(90);
const angle = ref(0);
Expand Down
35 changes: 10 additions & 25 deletions web/frontend/src/components/motor-detail.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

<script setup lang="ts">
import { grpc } from '@improbable-eng/grpc-web';
import { Client, motorApi } from '@viamrobotics/sdk';
import { displayError } from '../lib/error';
import { rcLogConditionally } from '../lib/log';
import InfoButton from './info-button.vue';
interface Props {
name: string
status: motorApi.Status.AsObject
client: Client
name: string;
status: motorApi.Status.AsObject;
client: Client;
}
const props = defineProps<Props>();
Expand All @@ -19,7 +17,7 @@ type MovementTypes = 'go' | 'goFor' | 'goTo';
const position = $ref(0);
const rpm = $ref(0);
const power = $ref(25);
const power = $ref(50);
const revolutions = $ref(0);
let movementType = $ref('Go');
Expand Down Expand Up @@ -61,7 +59,7 @@ const setDirection = (value: string) => {
};
const setPower = () => {
const powerPct = power * direction / 100;
const powerPct = (power * direction) / 100;
const req = new motorApi.SetPowerRequest();
req.setName(props.name);
req.setPowerPct(powerPct);
Expand Down Expand Up @@ -111,7 +109,6 @@ const motorStop = () => {
rcLogConditionally(req);
props.client.motorService.stop(req, new grpc.Metadata(), displayError);
};
</script>

<template>
Expand Down Expand Up @@ -150,16 +147,10 @@ const motorStop = () => {
</div>

<div>
<div
class="border border-t-0 border-black p-4"
>
<div class="border border-t-0 border-black p-4">
<v-radio
label="Set Power"
:options="
status.positionReporting
? 'Go, Go For, Go To'
: 'Go'
"
:options="status.positionReporting ? 'Go, Go For, Go To' : 'Go'"
:selected="movementType"
class="mb-4"
@input="setMovementType($event.detail.value)"
Expand All @@ -171,9 +162,7 @@ const motorStop = () => {
>
<div class="flex items-center gap-1 place-self-end pr-2">
<span class="text-lg">{{ movementType }}</span>
<InfoButton
:info-rows="['Relative to Home']"
/>
<InfoButton :info-rows="['Relative to Home']" />
</div>
<v-input
type="number"
Expand All @@ -196,9 +185,7 @@ const motorStop = () => {
>
<div class="flex items-center gap-1 place-self-end pr-2">
<span class="text-lg">{{ movementType }}</span>
<InfoButton
:info-rows="['Relative to where the robot is currently']"
/>
<InfoButton :info-rows="['Relative to where the robot is currently']" />
</div>
<v-input
type="number"
Expand Down Expand Up @@ -227,9 +214,7 @@ const motorStop = () => {
>
<div class="flex flex-wrap gap-2">
<span class="text-lg">{{ movementType }}</span>
<InfoButton
:info-rows="['Continuously moves']"
/>
<InfoButton :info-rows="['Continuously moves']" />
</div>
<v-radio
label="Direction of Rotation"
Expand Down
2 changes: 1 addition & 1 deletion web/runtime-shared/static/control.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/runtime-shared/static/control.js.map

Large diffs are not rendered by default.

0 comments on commit 61dc278

Please sign in to comment.