Graphics Guru questions

For general discussion related FlowStone
Post Reply
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

Graphics Guru questions

Post by fixstuff555 »

Hi all,

I have some questions on building a small display box. I'm not a graphics guy by any means, and was wondering how to go about it, especially with the Ruby capabilities now.

I have a robot with distance feedback in inches from each wheel. I would like to take that inch data and display it on a graphic window, so that it's previous track could be viewed.

How would I go about doing this?

I have looked in the examples but couldn't really find anything applicable.

What I'm looking for is a box that could rotate based on a heading float input, and could move the box around in a window, with the old track displayed.

Any ideas? Does the user manual cover graphics like this?
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Graphics Guru questions

Post by trogluddite »

Hi fixstuff,

The vector style graphics that can be programmed in Ruby would be ideal for this, as it works much like the old "Turtle"/'Logo' graphics where you can plot true arcs and lines that join end to end.
They're not quite finished yet, but the graphics programming classes that I'm working on might help with that, as they define commands for rotations, translations etc. that aren't there in the standard graphics methods.

The trickiest bit will probably be the 'dead-reckoning' of the position - but that depends what kind of moves your robot can make. I'm guessing from your post that it is 'tank style' - i.e. a wheel on each side where moving them at the same speed = straight line, and you control them independently to turn. If turning is limited to rotating on the spot, then that is easy, but for more gentle curves you need to know a little more geometry to work out the angle turned and the centre of rotation - something like on this web-page (the code is in 'C', i think, but the maths would convert to Ruby quite easily).
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

Re: Graphics Guru questions

Post by fixstuff555 »

Thanks Trog! Your awesome :)
Post Reply