arizzitano / petbot

Remote controlled telepresence robot
32 stars 11 forks source link

No hardware #2

Closed danriti closed 11 years ago

danriti commented 11 years ago

The goal of this pull request is to modify petbot to be developed without any hardware (arduino, RC car, etc)! This will hopefully help lower the bar for entry and allow more people to hack on this repository.

Goals:

danriti commented 11 years ago

@arizzitano this is a work in progress! i think an MVP simulator would be a neat addition to this project and allow others to play with the interactions without any actual hardware.

let me know if you have any thoughts or suggestions!

arizzitano commented 11 years ago

@danriti This is awesome, thanks! The project was desperately in need of a config file -- I've just been using Heroku environment variables. I totally agree about the no hardware option. I got it (semi)working on Raspberry Pi last night, and realized the local server should probably be abstracted away from the low-level stuff like board connections & pin numbers. This could make it easier not only to run with no hardware, but also to add options for other microcontrollers!

I think a simulator sounds like a great idea. For development I've been just console.loging the directions received from the remote server, but obviously it would be nicer to have something a little more fleshed out -- what sort of thing did you have in mind?

danriti commented 11 years ago

@arizzitano agree with your abstraction comment, that would be quite nice!

the basic idea for the simulator would be to piggy back onto the socket io server (since it's broadcasting) and capture the movement commands from the web server and translate them into physic simulations of the a "virtual RC" car driving. since this is an MVP, i'd basically want to textually display the following:

$ ./virtual-rc-sim

Velocity: 05 mph  Heading: 060  Direction: Forward

the "virtual RC" car would be driving in an infinite space, so it won't have any obstacles to collide with as you drive. this would give a good starting point and allow a solid base to start from if we want to get into a crazier simulator (graphics, obstacles, etc).

as far as the config file goes, would that be something you'd want to merge in sooner rather then later?

arizzitano commented 11 years ago

The simulation stuff sounds awesome! I assume that's how things like Roombas track their positions. Measuring velocity/heading will be pretty tricky and probably necessitate additional device hardware. Turn angle, velocity, acceleration, and deceleration are all subject to change based on car mass, surface friction (e.g. carpet vs hardwood), and battery charge, so I'm thinking it might be a good idea to hook into the motor itself. In production we can use the device readings to determine position, but for the simulation we could probably just use average or ideal readings as constants. To start, we could probably just make stuff up.

Anyway let's not get too ahead of ourselves. Are you done with the config stuff? I'd like to merge it in so I can use it for some new features.

danriti commented 11 years ago

Yah, feel free to merge in the config stuff now. It was my first pass on it, so feel free to improve it if you have any ideas.

As far as the simulations go, I'm just gonna use "perfect world" scenarios/variables/constants to start. And then make up things as I go =)