0.8.1 ev3pcsamples error on build.xml

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

Moderators: roger, gloomyandy, skoehler

0.8.1 ev3pcsamples error on build.xml

Postby Iburong » Sat Apr 19, 2014 8:34 am

Hello,

I´m trying to get the barchart example working with my EV3 Ultrasonic Sensor, but the build file does get this error on eclipse: default target copy does not exist in this project.

It seems this file is a wrong one, as is very, very small only a couple of lines. Yesterday I tried to get the EV3Chart example working with 0.8.0 version, the ant file was bigger and it ran ok, but when I tried the barchart example it didn´t find the jfree jar, I think it did not pack them with the build, but only used the libraries for compiling the sample, and the brick didn´t have them.

I´m not very skilled at ant building files, it has been years since I used one, these days I use Maven at work and hobby projects. Could some one please provide me a working example of a lejos ant file or template for using lejos with third party libraries and send them to the brick? Better if it´s the barchart example, as I can´t build a robot at the moment and I´m using the ev3 brick with some sensors conected for my java trials, would be easier for me if plotting some kind of graphs with sensors values.

Thank you
Iburong
New User
 
Posts: 8
Joined: Fri Apr 18, 2014 8:38 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby lawrie » Sat Apr 19, 2014 10:02 am

You don't need an ant build file for running pc samples. The one that is there is only needed to satisfy the release system. I will probably remove it in a future release.

Have you installed the Eclipse plugin?

If you have then, you should have a library container called LeJOS EV3 EV3 Runtime. That will include the jfreechart libraries.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby Iburong » Sat Apr 19, 2014 11:19 am

Ok, I got confused about the pc-ev3 thing, the last time I did something related to remote or distributed programming was with EJB, a different kind of beast...

So, delete those build files and the project compiles fine, but the thing is I don´t get any kind of tab or frame if I execute barchart.java as a Lejos Program with the plugin, this is what I get in console:

Jar file has been created successfully
Using scp for upload and ssh to execute program
Uploading to 192.168.2.14 ...
Running program ...
EV3ScpUpload has finished
leJOS EV3 plugin launch complete

I think I´m doing something wrong here, the ev3 examples work fine, but not this pc thing.

I´m totally clueless about this, someone please help me :D
Iburong
New User
 
Posts: 8
Joined: Fri Apr 18, 2014 8:38 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby lawrie » Sat Apr 19, 2014 12:44 pm

You need the plugin to get the reference to jfreechart etc., but you don't run the pc samples as a leJOS EV£ program. You just run them as a Java program.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby Iburong » Sat Apr 19, 2014 2:27 pm

Ah, that makes sense, this stuff is new for me and I got a little confused with it. But it didn´t work for me.

I ran it as a normal Java program, and it worked until the point to execute sp.fetchSample(), then I got a nullpointer.

I´ve been debugging the execution, and it gets a sampleProvider of the class I configured in the properties, and also the correct port. But it does not work.

Maybe it´s something about the configuration files. I´ve changed only the port, the host, and the sensor types, as I don´t have the ones of the samples, instead I´ve used this classes: lejos.hardware.sensor.EV3UltrasonicSensor and lejos.hardware.sensor.EV3GyroSensor.

The sensors work perfectly with the same ports at the EV3 control center, so I think it´s not a hardware problem.

I´ve updated recently to the latest lejos plugin.
Iburong
New User
 
Posts: 8
Joined: Fri Apr 18, 2014 8:38 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby lawrie » Sat Apr 19, 2014 4:57 pm

You are making progress. I get the null pointer exception when a sensor is not plugged in. BarChart works for me when I plug the EV3 IR sensor in sensor port 1, without changing the configuration file.

The remote sensor classes need some work on them to make them more robust. I need to fix the null pointer exception.

What you are doing with the configuration files sound correct. I don't have the EV3 gyro sensor or EV3 ultrasonic sensor to test. The problem might be to do with modes which I don't think are fully supported at the moment. It may be it only works currently if the sensor class implements SensorMode - I will check. I did test the samples with some of the NXT sensors, and they worked for me.

I was in two minds about including the PC samples in the release as I knew they were poorly tested, but it is good to get feedback on the problems.

The difference between projects that run on the PC and those that run on the EV3 is confusing at the moment. On the NXT, we had the concept of a PC project and a NXT project and the plugin allowed you to choose the type of project. Currently with the EV3 we have just one type of project and you choose whether to run it as a Java project or an EV3 project. We will probably restructure the jar files in the next release or the one after to make it clearer what runs on the PC, what runs on the EV3, and what can run on either.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby lawrie » Thu Apr 24, 2014 5:22 pm

In the latest Git version, I have now implemented modes, improved the error handling and made both the EV3 Ultrasonic and EV3 Gyro sensor work. You need both ev3classes and ev3pcsamples if you want to try it.

With the 0.8.1 version, I noticed that if you left the properties file specifying the IR class but plugged in the Ultrasonic sensor, you got readings from it.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Re: 0.8.1 ev3pcsamples error on build.xml

Postby Iburong » Sun Apr 27, 2014 4:35 pm

Well, that makes sense with a test I did with the latest version of the scratch-lego project by botkop, the US sensor was getting readings as it were the Infrared one that the code supported.

I´ll try your changes some time next week if I get a chance, too busy at this time :( .

Thanks
Iburong
New User
 
Posts: 8
Joined: Fri Apr 18, 2014 8:38 pm


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff