Search found 5998 matches

by gloomyandy
Sat Feb 24, 2018 8:13 pm
Forum: EV3 Software
Topic: How to safely stop a thread
Replies: 10
Views: 44

Re: How to safely stop a thread

The final version were you set the boolean inside the setFlag method is probably best. You may want to modify your run method so that the code that plays the beep and sleeps is outside of the synchronized block. Doing that should allow the boolean to be set in a timely fashion.
by gloomyandy
Fri Feb 23, 2018 4:26 pm
Forum: EV3 Software
Topic: How to safely stop a thread
Replies: 10
Views: 44

Re: How to safely stop a thread

Much better, but you should probably set the flag inside of the synchronized block, also it would be better to have methods called something like, startBeep and stopBeep (which can then call setFlag) rather than calling setFlag directly.
by gloomyandy
Fri Feb 23, 2018 4:22 pm
Forum: EV3 Software
Topic: MovePilot arc(): unexpected behaviour
Replies: 5
Views: 21

Re: MovePilot arc(): unexpected behaviour

A short sleep would probably be better.
by gloomyandy
Thu Feb 22, 2018 8:51 am
Forum: EV3 Software
Topic: MovePilot arc(): unexpected behaviour
Replies: 5
Views: 21

Re: MovePilot arc(): unexpected behaviour

If you want to track the position of a robot using the Chassis class why not just use the PoseProvider that is built into the class. It works very well. See: https://lejosnews.wordpress.com/2016/02/06/improving-position-tracking-of-a-mobile-robot/ which compares the built in tracking to that provide...
by gloomyandy
Wed Feb 21, 2018 9:18 pm
Forum: EV3 Software
Topic: MovePilot arc(): unexpected behaviour
Replies: 5
Views: 21

Re: MovePilot arc(): unexpected behaviour

For continuous movement, use the Chassis methods directly. Using the setVelocity methos will let you specify a move in terms of both linear and angular velocity. If you provide a non zero value for both you will get a smooth arc movement. Setting the angular velocity to zero drives straight and sett...
by gloomyandy
Tue Feb 20, 2018 8:54 pm
Forum: EV3 Software
Topic: How to safely stop a thread
Replies: 10
Views: 44

Re: How to safely stop a thread

The ones from Oracle are pretty good...
https://docs.oracle.com/javase/tutorial/

But there are lots out there, I'm sure you will find something that works for you.
by gloomyandy
Tue Feb 20, 2018 5:23 pm
Forum: EV3 Software
Topic: How to safely stop a thread
Replies: 10
Views: 44

Re: How to safely stop a thread

It will probably be fine, but what you have there is what is known as a busy/wait loop which will basically use the cpu all of the rime, there are much better ways to communicate between threads (take a look at notify/wait), at the very least you should probably but a short (say 20mS) sleep in there...
by gloomyandy
Tue Feb 20, 2018 1:00 pm
Forum: EV3 Software
Topic: How to safely stop a thread
Replies: 10
Views: 44

Re: How to safely stop a thread

The exception you are getting is because you can only start a Thread object once. When it exits you can not restart it by calling start again, you need to create a new instance of Thread each time. You should also probably make sure that the original instance has actually stopped before you continue...
by gloomyandy
Mon Feb 19, 2018 7:48 am
Forum: NXJ Software
Topic: Run NXT Motors on SensorPort
Replies: 3
Views: 30

Re: Run NXT Motors on SensorPort

I'm not sure what you mean. There is no way with the NXT hardware to run a motor directly from a sensor port, so no way to enable it. leJOS already has support for various motor muxes that use add on hardware to control a motor via external hardware. See... http://www.lejos.org/nxt/nxj/api/lejos/nxt...
by gloomyandy
Mon Feb 12, 2018 8:18 pm
Forum: EV3 Software
Topic: OpenCV query
Replies: 2
Views: 26

Re: OpenCV query

We ship 2.4.11 of openCV with leJOS. I did get 3.0 working on the EV3 (it is in our git repo), but at the time 3.0 was very new and all of the examples seemed to be for 2.4, also 3.0 seemed to be slower than 2.4 and given that the EV3 is not very powerful it seemed that 2.4 was the best bet.
by gloomyandy
Sun Feb 11, 2018 4:30 pm
Forum: EV3 Software
Topic: Long setup time for sensors
Replies: 2
Views: 34

Re: Long setup time for sensors

Yep that is pretty much correct. UART based sensors (basically the new ones from LEGO like the EV3 color, EV3 Ultrasonic, EV3 IR etc.) all take a long time to initialise. You basically don't see this time with the LEGO software because the sensor initialisation time is "hidden" by the LEGO...
by gloomyandy
Sat Feb 10, 2018 8:21 pm
Forum: NXJ Hardware
Topic: Full loss of motor control after installation
Replies: 1
Views: 17

Re: Full loss of motor control after installation

Are you sure that the problem is not with your motors or cables? There have been no other reports of this type with leJOS and it seems strange that you have managed to to whatever it is you have done to two NXTs! I also note from your earlier post that you had some sort of motor control issue earlie...
by gloomyandy
Thu Feb 08, 2018 3:59 pm
Forum: leJOS EV3 Development
Topic: Working with the source code
Replies: 4
Views: 37

Re: Working with the source code

You won't be able to see the Linux file system on the SD card from a PC. The easy way is probably to transfer the file when the EV3 is running. There are various ways to do this (the ant files show one way). Do you know anything about Linux? If you are going to do anything serious with the EV3 you r...
by gloomyandy
Thu Feb 08, 2018 3:21 pm
Forum: EV3 Software
Topic: External Jar libraries on EV3
Replies: 6
Views: 760

Re: External Jar libraries on EV3

It probably could be addressed, however, I'm not sure there will ever be an updated release, there has been very little activity over the last year or so. But who knows perhaps someone will take it on!
by gloomyandy
Thu Feb 08, 2018 9:17 am
Forum: leJOS EV3 Development
Topic: Working with the source code
Replies: 4
Views: 37

Re: Working with the source code

If you build a new ev3class.jar file then you need to update the copy of this file that is on your ev3. Otherwise you will be compiling against one version but running with a different one. You will also need to restart the EV3 (or at least the menu as that will be using the "old" ev3class...

Go to advanced search