GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jpvolt/fsdviewer: simple 2d viewer for formula student driverless software

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
fsaeviewer
fsaeviewer
 
 
imgs
imgs
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

fsdviewer

simple 2d viewer for formula student driverless software

This simple library was written to help the development of algorithms(slam and path planning). The idea is simple, you can add one function to your main loop, pass a list of what you want to draw and thats it.

Features

  • Draw cones(circles) in multiple colors and sizes
  • Draw Multiple Cars
  • Draw lines between cones
  • Draw lines between lines
  • Move and zoom in and out

Tutorial

Install via pip

pip3 install fsd-viewer-jpvolt

Import the library

from fsdviewer import viewer2d # import viewer
from fsdviewer.viewer2d import Car, Cone, Line, LineMiddle # import drawable objects

Create 4 lists, one for each drawable object type

conesList = []
linesList = []
middleLineList = []
carList = []

update the lists with what you want to draw

### your code 
coneList.append(Cone(color='red', x=10, y=10, size=5))

Add draw call to your main loop

### your code ...
while(true): ### your main loop
    viewer2d.draw(conesList, linesList, middleLineList, carList)

And that´s it.

Creating drawable objects

Cones

cone = Cone(color='blue', x=10, y=10, size=5))

x, y and size are in pixels units Avaliable cone colors:

  • 'blue'
  • 'yellow'
  • 'orange'
  • 'green'
  • 'black'

Lines

Lines creates lines bettween cones

line = Line(cone1=0, cone1=2, color='red',  size=5))

cone1 and cone2 are cones index in cone lists Avaliable line colors:

  • 'red'
  • 'blue'
  • 'yellow'
  • 'orange'
  • 'green'

MiddleLines

MiddleLine creates a line bettween lines

mline = MiddleLine(cone1=0, cone2=1,cone3=3, cone4=4 color='red',  size=5))

cone1, cone2, cone3, cone4 are cones index on cone list to be connected with line Avaliable line colors:

  • 'red'
  • 'blue'
  • 'yellow'
  • 'orange'
  • 'green'

Cars

car = Car(x=10, y=10, rot=0.5, color='black')

x, y are in pixels rot is the rotation of the car, in radians Avaliable car colors:

  • 'blue'
  • 'green'
  • 'blue'

About

simple 2d viewer for formula student driverless software

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.