To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / *2224 (-20)
  thread class for legOS
 
I write a Thread class for LegOs with a simple interface like in Java or CommonC++. I'm using LegOs 0.2.4. Below are my work till yet. The problem is in the Method Start(). The line is marked with !!. The error message is at the end of the file. I (...) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: LNP Routing daemon with tcp/ip for RCX/legOS, Cybermaster/NQC
 
"Freddy" <mail-nowak@web.de> schrieb im Newsbeitrag news:GpzyB6.Kpt@lugnet.com... (...) A C++ class to build client application without knowing the LNPoI protocol is available for Windows and Linux now. (URL) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
(...) I would strongly suggest changing this to while(1) msleep(bignumber);. Otherwise you're hogging the processor doing nothing important, which could do bad things to any compute-intensive tasks you may have going. It'll also use slightly less (...) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
Hi Ross (...) you (...) What are the advantages and disadvantages of this method as opposed to the one I used? mike (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
(...) Note also since bumper_task() is an infinite loop, and you never use pid1, you could save one thread by doing this: int main(int argc, char *argv[]) { pid2 = execi (&left_task, 0, NULL, PRIO_NORMAL+2, DEFAULT_STACK_SIZE); pid3 = execi (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
;-) That worked a treat, thanks Michael. (thanks for the other little corrections in the code too). mike (...) Mike, (...) your subroutines and then you leave main()! Leaving main means (...) memory is freed. The following will do the job: (...) (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
Hi Mike, your problem is not because of an error in legOS. But what you do is that you start your subroutines and then you leave main()! Leaving main means that all your allocated memory is freed. The following will do the job: ---...--- cut here (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  IRC
 
Anyone who is a regular user of IRC can join my channel #LegoMindstorms (on dalnet). Coma and chat or give/recieve assistance. If you join you are welcome to Ops because anyone in here will know more about Mindstorms than me as i know almost (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)  
 
  Re: threads
 
Albert (...) yea, I see what you are getting at. I am sure that I was hitting the bumper while the threads were still alive, but I will check again. I think this also points out some of the dangers of just dumping in some poorly thought out dummy (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
(...) As pointed by Albert Huang, you cannot call kill() with an "invalid" pid. Actually, the comment above kill() in tm.c says: //! kill a process /*! \param pid must be valid process ID, or undefined behaviour will result! The function updates (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads
 
two of your threads terminate shortly after being started (...) as far as I know, legOS provides no functionality for determining whether or not a thread is alive or not. You need to keep track of this yourself (e.g. using a variable/flag that gets (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
Hi again I have now totally stripped down my code to a minimum and I am still having problems with the code hanging up. I can see nowhere where there can be a fault. I am a long way from being an expert, but is it possible there is a bug in the (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: Cygwin problems
 
Ben I recommend you read the Howto from the sourceforge docs section, or even better buy the Extreme Mindstorms book (Extreme Mindstorms; D. Baum, M. Gasperi, R. Hempel, L. Villa; Apress; ISBN: 1893115844 ) . Both give a good explanation of legOS. (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Cygwin problems
 
Hi all, i am having problems with cygwin. It doesnt help that i dont know what all these linux commands mean but i will explain my problems now. I have intstalled all the software to my system ok and the linux emulator seems to work fine(i can use (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads
 
Thanks Albert (...) still (...) How do I check this? There are no other tasks that can kill threads apart from this one. I also checked process IDs after creation and before killing. Best regards, mike (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads
 
some suggestions: 1) random_delay = random()/1000000; LegOS uses 16 bit integers, meaning the largest value an integer can have is something like 65535. The above statement is meaningless 2) (...) If you kill a thread, make sure it's still a valid (...) (23 years ago, 15-Jan-02, to lugnet.robotics.rcx.legos)
 
  LNP Routing daemon with tcp/ip for RCX/legOS, Cybermaster/NQC
 
Dear NG, i try to develop a LNP routing daemon (LNPoI - Lego Network Protocol over Internet)and i think this peace of software can be also usefull to other people using legOS, RCX and Cybermasters (!). For now it´s only available as a binarie file (...) (23 years ago, 15-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads
 
Hi again, I'm now totally stuck with this problem. I've spent all day at it, stepping through the code line by line with key presses. I've marked the point that the code appears to hang in left_control_task (). Someone please help, please. Thanks (...) (23 years ago, 15-Jan-02, to lugnet.robotics.rcx.legos)
 
  threads
 
Hi, I'm struggling to get threads working (in a simple motor speed matching program), the code just keeps hanging up. I've isolated the problem to when I restart the threads after killing them if a bumper is hit in the bumper_task() function. The (...) (23 years ago, 14-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: Measuring robot turn angle
 
Wanted to thank everybody for replies. I ended up attaching an 80-tooth gear to the rear axle (wheels are on the front set) after extending the axle. The rotation sensor is mounted on the chassis outside with an 8-tooth gear meshing to the other (...) (23 years ago, 13-Jan-02, to lugnet.robotics.rcx.legos)


Next Page:  5 more | 10 more | 20 more

Redisplay Messages:  All | Compact

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR