Travelled distance on Screen - possible ?

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

Travelled distance on Screen - possible ?

Postby leJosNeedHelp » Wed Jan 29, 2014 12:19 pm

Hey guys,

I've written a simple program where my ev3 is driving across the room. Now i wanted to put the travelld distance on my Screen, like a map. Is this possible?
Or how can I do that, are there any methods? I've no Idea how I could start. Do I need a JFrame for this?
Last edited by leJosNeedHelp on Wed Jan 29, 2014 12:41 pm, edited 2 times in total.
leJosNeedHelp
New User
 
Posts: 18
Joined: Tue Sep 24, 2013 7:33 am

Re: Travelled distance on Screen - possible ?

Postby leJosNeedHelp » Wed Jan 29, 2014 12:34 pm

I think "LineMap" is the class I need, am I right?
Maybe I can create a svg File and use this to put the travelled distance on the screen? Is this possible? If so, how can i use the 'createSVGFile(String)' Methode? I tried to gerenate a new LineMap Object, but it hasn't any methodes :-/
leJosNeedHelp
New User
 
Posts: 18
Joined: Tue Sep 24, 2013 7:33 am

Re: Travelled distance on Screen - possible ?

Postby M13 » Tue Feb 04, 2014 10:48 am

You will probably need a JFrame. And the LineMap might be useful as well. There are obviously quite some classes in the robotics package that might be halpful for what you intend to do (unfortunately, I can't point out "the best" way for achieving your goal (although that's a task for the DijkstraPathFinder anyhow :D )). But maybe it helps when you describe how you are currently controlling your robot. Are you using some of the infrastructure described at http://www.lejos.org/nxt/nxj/tutorial/W ... hicles.htm ?
M13
New User
 
Posts: 4
Joined: Thu Jan 16, 2014 9:56 pm

Re: Travelled distance on Screen - possible ?

Postby roger » Tue Feb 04, 2014 8:25 pm

if you are using a Navigator or PoseProvider on your robot, it will update the x,y and heading of the robot at the completion of every move. If you can establish a connection between your robot and the PC and use a data stream to transmit the x and y coordinates to tje program running on the PC, then you could convert the robot x and y to the screen x and y pixel coordinates and draw a line between the old and new coordinates.
If you can manage all that, I could like to know how you established the communication link.
Roger
roger
Moderator
 
Posts: 350
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA


Return to EV3 Software

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

more stuff