GithubHelp home page GithubHelp logo

novakasa / brickrail Goto Github PK

View Code? Open in Web Editor NEW
83.0 6.0 7.0 43.86 MB

LEGO Train automation software for PoweredUp

License: MIT License

Python 26.75% GDScript 73.25%
godot pybricks lego trains poweredup

brickrail's People

Contributors

novakasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

brickrail's Issues

can_flip flag for blocks

this makes it possible to have blocks that are too short for some trains, when we set both can_stop and can_flip to false, so the train only ever passes. Should also be useful for gradient blocks.

persistent and synced settings

settings should be stored in user folder

probably use json again

also that's where layouts should be stored by default?

block connection restrictions doesn't allow reconnection

if track connecting to block is deleted, you currently can't connect it again because it doesn't allow new connections (to prevent a switch being created). Should probably check for that case so you can connect the block again

remove user facing facing

we don't really need control over which end of the block the train stays at anymore, flipping the heading at the end will be very short since the train only needs to go to the other end of the last marker it detected

unfolded layer view

layer view mode that shows the separate layers next to each other instead of just showing the active layer

for this we need a "bounding box" for our layout.
should probably not allow layout editing in this view, as extending the bounding box dynamically might introduce a lot of headache
should the user be able to edit the positions of each layers? or should it be a grid pattern governed by the bounding box?
if the user can edit the positions, we should make only the tracks render,

manual vs automatic controls

Clean up UX regarding mixed usage of manual and automatic controls

Probably need to have some hard switch that won't allow manual controls of trains and switches when they are currently used automatically.
Also improve UX to ensure the real trains are in correct position when auto mode is engaged.

Plan for hub firmware install and connection strategy

Should have a built-in way to flash pybricks onto a hub. With this we can give it a unique name, and already decide there what type of device it will be (train vs layout controller) and store the correct mpy program on it (future). The name will be stored with the layout.

Can also add a hub by its unique name, but it will only connect to a hub that has this name.

Should also add a button to add a device by connecting to a pybricks hub.

Add a button to connect all devices

track shader borders inaccurate antialiasing

image
image
This is probably because the state is not well defined at the border. Maybe state should be applied close to a given shape? Maybe we can "anti-alias" the state itself somehow?

cancel route

should put the stop intention at the current leg and then set the route to null

deleted block issue with sensors

when deleting block and creating shorter block on same segment again, error regarding sensor occurs. need to investigate further

greedy route legs

a leg should have a check_greedy() func that returns True if the greedy flag is set in the target block or if it is a flip leg and the next leg exists.

We check for this func to make sure we lock this and the next leg at the same time, making sure that the train doesn't have to wait after this leg.

This helps with not executing a flip leg if the train can't continue after that anyway or with blocks that are not supposed to be stopped at but serve the purpose of freeing up previous blocks while the train is moving.

implement procedural color theme

to make it easier to customize the colors. Research ways to generate a bunch of good looking colors based on a simple palette

dynamic leg intention change behavior

need a signal that notifies the train that the intention of the current leg changed while the train had already reacted to the intention (after "enter" key)
Then the train will request a new behavior from the route, and execute it.
The route also needs to lock the next leg if the new intention == "pass".

This is probably required for multiple ble trains.

error when switch with assigned motor is selected and layout cleared

This is because when the controller is removed we try to select the current controller again in the new option list, but it doesn't exist anymore.

Probably should fix it by reacting already to the controller "removing" signal rather than controllers_changed signal. Probably use the same approach for trains as well where I applied a band aid fix earlier.

undo/redo

Have a class for an editor action that can sequentially store function calls and their respective undo functions (like in godot).

double load of layout with blocks produces errors

blocks are wiped first, when tracks are disconnected the state update needs to get the block references. superficial fix: change order of deleting tracks/blocks (tracks first).
But need to solve this more sustainably by removing any references to blocks once a block is deleted

refactor Track and DirectedTrack

right now the compositional relationship between Track and DirectedTrack is ambiguous. DirectedTrack has a track reference to check for connected DirectedTracks.
Connections should be refactored into DirectedTrack so no reference to Track is needed.

layer support

on the low level multiple layout instances and on a higher level just have "portals" between them. That would make it possible to introduce "portals" that don't necessarily correspond to the same coordinates.

or on a low level just have different layers assigned to each track and make it possible to filter the view. This would make it easy to have bridges on the same view. This would be harder to implement and might not be as flexible. This could be implemented on top of the previous paradigm as well.

more efficient communication with BLETrain

this will be necessary for #39, since we want to communicate more complex instructions

this is already WIP, use single byte to tell type of data, and some kind of hash for the rpc function names, remove whitespace of repr before sending

multiple paths between same nodes can't be used in case of crossing blocked or similar

in the layout that was added in e20219a the train doesn't take the shorter one by default. even when the longer one is blocked by crossings, it doesn't chose the other route.
This is because the edges of nodes are stored in dictionaries with keys corresponding to the targets. This means there will only be one edge collected.
This might be a low priority issue because if there are blocks on one of the routes, the problem doesn't occur (no same start and end nodes)

progress notifications during operations

when connecting a hub, running a program or quitting the program (which waits for disconnects and stuff) we should have some kind of notification so that the user knows something is happening

most operations should have some timeout error

refactor layout segments for route finding

each node should be associated with a single directed_track.
Then a Segment should run from the first track after the previous node until including the next node.
A block is always associated with the last track on it's segment.

ble devices clean quit

each hub should have a coroutine that cleanly stops hub programs and then disconnects the hub
one main cleanup coroutine manages the coroutines for each hub and at the end the ble server can be disconnected/killed

train reliability improvements

Instead of just sending the next expected marker and the behavior, send the full list of markers until the next block, with markers tagged if they have a role in the block, and also send the expected behaviour (stop in block / pass the block)

That way, if something changes (can't pass anymore) we just have to send the new behavior and the train itself knows whether it should have slowed down by now and correct for it.

All other solutions are unreliable since we don't know for sure if the train already passed a specific marker or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.