Skip to content

Commit

Permalink
Added RPM to EscStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
cedbossneo committed Oct 20, 2024
1 parent 6826f95 commit 19d9a07
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/msgs/mower_msgs/ESCStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type ESCStatus struct {
Status uint8
Current float32
Tacho uint32
Rpm int16
TemperatureMotor float32
TemperaturePcb float32
}
3 changes: 2 additions & 1 deletion pkg/msgs/xbot_msgs/SensorInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
SensorInfo_VALUE_DESCRIPTION_CURRENT uint8 = 5
SensorInfo_VALUE_DESCRIPTION_PERCENT uint8 = 6
SensorInfo_VALUE_DESCRIPTION_DISTANCE uint8 = 7
SensorInfo_VALUE_DESCRIPTION_RPM uint8 = 8
SensorInfo_FLAG_GPS_RTK uint16 = 1
SensorInfo_FLAG_GPS_RTK_FIXED uint16 = 2
SensorInfo_FLAG_GPS_RTK_FLOAT uint16 = 4
Expand All @@ -27,7 +28,7 @@ const (

type SensorInfo struct {
msg.Package `ros:"xbot_msgs"`
msg.Definitions `ros:"uint8 TYPE_STRING=1,uint8 TYPE_DOUBLE=2,uint8 VALUE_DESCRIPTION_UNKNOWN=0,uint8 VALUE_DESCRIPTION_TEMPERATURE=1,uint8 VALUE_DESCRIPTION_VELOCITY=2,uint8 VALUE_DESCRIPTION_ACCELERATION=3,uint8 VALUE_DESCRIPTION_VOLTAGE=4,uint8 VALUE_DESCRIPTION_CURRENT=5,uint8 VALUE_DESCRIPTION_PERCENT=6,uint8 VALUE_DESCRIPTION_DISTANCE=7,uint16 FLAG_GPS_RTK=1,uint16 FLAG_GPS_RTK_FIXED=2,uint16 FLAG_GPS_RTK_FLOAT=4,uint16 FLAG_GPS_DEAD_RECKONING=8,uint16 FLAG_SENSOR_FUSION_RECENT_ABSOLUTE_POSE=1,uint16 FLAG_SENSOR_FUSION_DEAD_RECKONING=8"`
msg.Definitions `ros:"uint8 TYPE_STRING=1,uint8 TYPE_DOUBLE=2,uint8 VALUE_DESCRIPTION_UNKNOWN=0,uint8 VALUE_DESCRIPTION_TEMPERATURE=1,uint8 VALUE_DESCRIPTION_VELOCITY=2,uint8 VALUE_DESCRIPTION_ACCELERATION=3,uint8 VALUE_DESCRIPTION_VOLTAGE=4,uint8 VALUE_DESCRIPTION_CURRENT=5,uint8 VALUE_DESCRIPTION_PERCENT=6,uint8 VALUE_DESCRIPTION_DISTANCE=7,uint8 VALUE_DESCRIPTION_RPM=8,uint16 FLAG_GPS_RTK=1,uint16 FLAG_GPS_RTK_FIXED=2,uint16 FLAG_GPS_RTK_FLOAT=4,uint16 FLAG_GPS_DEAD_RECKONING=8,uint16 FLAG_SENSOR_FUSION_RECENT_ABSOLUTE_POSE=1,uint16 FLAG_SENSOR_FUSION_DEAD_RECKONING=8"`
SensorId string
SensorName string
ValueType uint8
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/SettingsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export OM_AUTOMATIC_MODE=0
export OM_OUTLINE_OFFSET=0.05
export OM_NO_COMMS=true
export OM_NO_COMMS=false
# Set default GPS antenna offset
export OM_ANTENNA_OFFSET_X=0.3
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/StatusComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function StatusComponent() {
<Col lg={8} xs={12}><Statistic title="Status" value={escStatus?.Status}/></Col>
<Col lg={8} xs={12}><Statistic precision={2} title="Current" value={escStatus?.Current}/></Col>
<Col lg={8} xs={12}><Statistic precision={0} title="Tacho" value={escStatus?.Tacho}/></Col>
<Col lg={8} xs={12}><Statistic precision={0} title="RPM" value={escStatus?.Rpm}/></Col>
<Col lg={8} xs={12}><Statistic precision={2} title="Motor Temperature" value={escStatus?.TemperatureMotor}
suffix={"°C"}/></Col>
<Col lg={8} xs={12}><Statistic precision={2} title="PCB Temperature" value={escStatus?.TemperaturePcb}
Expand Down Expand Up @@ -68,4 +69,4 @@ export function StatusComponent() {
</Card>
</Col>
</Row>;
}
}
1 change: 1 addition & 0 deletions web/src/types/ros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export type ESCStatus = {
Status?: string
Current?: number
Tacho?: number
Rpm?: number
TemperatureMotor?: number
TemperaturePcb?: number
}
Expand Down

0 comments on commit 19d9a07

Please sign in to comment.