Skip to content

Commit

Permalink
add vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Apr 11, 2024
1 parent 999666d commit 98b13ae
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
4 changes: 2 additions & 2 deletions botsim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ If your bot chassis specifies a texture, it will be overlaid on the bot.
- Copy the generated vertices to the chassis' "verts" field.
14. Reference the texture in your bot's chassis spec
- Set the chassis' "texture" field to the texture's relative path.
15. Specify where the (two) wheels are on the chassis
16. Specify the location of range sensor and line sensors
15. Specify where the (two) wheels are on the chassis, relative to center of chassis
16. Specify the location of range sensor and line sensors, relative to center of chassis
17. Copy over leds section (individual LEDs not supported)
18. Add bot to botsim/src/bots/index.ts

Expand Down
Binary file modified botsim/public/bots/fwdeducakit/chassis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions botsim/src/bots/fwdeducakit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { BotSpec, toWheels } from "./specs"

const spec: BotSpec = {
name: "Forward Education Smart Vehicle",
productId: 0xdeadbeef,
mass: 1,
weight: 126,
silkColor: "#000000",
chassis: {
shape: "polygon",
texture: "bots/fwdeducakit/chassis.png",
verts: [{ "x": -5.494855004677269, "y": 1.5931909982688979 },
{ "x": -4.568755846585594, "y": -4.043277553375649 },
{ "x": -4.476145930776426, "y": -4.144835545297172 },
{ "x": -1.6875584658559402, "y": -5.477784189267167 },
{ "x": 1.7081384471468661, "y": -5.496826312752453 },
{ "x": 4.373246024321796, "y": -4.278130409694172 },
{ "x": 4.496725912067353, "y": -4.170225043277553 },
{ "x": 4.5481758652946676, "y": -3.986151182919792 },
{ "x": 4.836295603367633, "y": -2.354875937680323 },
{ "x": 5.494855004677269, "y": 1.624927870744374 },
{ "x": 5.494855004677269, "y": 2.177149451817657 },
{ "x": 4.7025257249766135, "y": 5.173110213502596 },
{ "x": 4.332086061739944, "y": 5.471436814772072 },
{ "x": -4.270346117867166, "y": 5.477784189267167 },
{ "x": -4.681945743685688, "y": 5.071552221581073 },
{ "x": -5.494855004677269, "y": 2.240623196768609 } ]
},
wheels: toWheels({
separation: 13.5,
diameter: 6.0,
width: 0.7,
y: 3.0,
}),
rangeSensor: {
beamAngle: 25, // degrees
maxRange: 40, // cm
pos: { x: 0, y: -10.5 },
},
// Recognized line sensor names: "outer-left", "left", "middle", "right", "outer-right"
lineSensors: [
{
name: "left",
// offset to center of sensor from chassis center
pos: { x: -1.0, y: -9.5 },
},
{
name: "middle",
// offset to center of sensor from chassis center
pos: { x: -0.0, y: -9.5 },
},
{
name: "right",
// offset to center of sensor from chassis center
pos: { x: 1.0, y: -9.5 },
},
],
leds: [
{
name: "general", // Generalized/non-specific LED
pos: { x: 0, y: 0 },
radius: 0, // The "general" LED takes its shape and size from the chassis
},
],
}

export default spec

0 comments on commit 98b13ae

Please sign in to comment.