To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2744
2743  |  2745
Subject: 
Re: data recording in BrickOS ?
Newsgroups: 
lugnet.robotics.rcx
Date: 
Mon, 26 Sep 2005 14:17:08 GMT
Viewed: 
4573 times
  
Am Mon, 26 Sep 2005 12:35:05 GMT
"Francois Bardet" <f.bardet@voila.fr> tippte:

Hi Mindstormers,

1) Does BrickOS allow to write/read measured data into the RCX memory,
in order to plot or process it later on the computer ?
this is not the default
i programmed this functions, but the docu is in only in german avialible
if you can read german, have a look at
http://www.uni-kassel.de/~holler/ECRobot/
but there was an other implementation from  cs148 at Department of
Computer Science der Brown University at
http://www.cs.brown.edu/courses/cs148/brickOS
but this page exists no longer

If yes, what are the command lines to :
- allocate the memory space ?
- to write and read ?
- free this memory allocation ?
- send this data to the computer through the IR tower ?

2) Within BrickOS, how can I have my rcx wait for an IR order (from
the tower, or from an other rcx), without to much disturbing an other
task, (that means without wasting the rcx power).
have a look kernel/program.c

this example is waiting the command CMDgetlog
+ diff -rwBcpN brickos-0.2.6.10.6/kernel/program.c
legOS/kernel/program.c + *** brickos-0.2.6.10.6/kernel/program.c Tue Sep 24 05:10:06 2002
+ --- legOS/kernel/program.c Wed Jan 19 12:35:37 2005
+ *************** const unsigned char min_length[]={
+ *** 82,88 ****
+      4, // CMDdata
+      2, // CMDrun
+      2, // CMDirmode
+ !    2  // CMDsethost
+   };
+
+   static program_t programs[PROG_MAX];      //!< the programs
+ --- 82,89 ----
+      4, // CMDdata
+      2, // CMDrun
+      2, // CMDirmode
+ !    2,  // CMDsethost
+ !    2   // CMDgetlog
+   };
+
+   static program_t programs[PROG_MAX];      //!< the programs
+ *************** volatile unsigned char packet_len;
+ *** 92,97 ****
+ --- 93,99 ----
+   volatile unsigned char packet_src;        //!< packet sender
+
+   static sem_t packet_sem;                  //!< synchronization
semaphore + + sem_t log_sem;
+
+   #if 0
+   #define debugs(a) { cputs(a); msleep(500); }
+ *************** int program_valid(unsigned nr) {
+ *** 124,129 ****
+ --- 126,133 ----
+   static void program_run(unsigned nr) {
+     if(program_valid(nr)) {
+       program_t *prog=programs+nr;
+ +     //! reset the log semaphore
+ +     sem_init(&log_sem,0,1);
+
+       // initialize data segments
+       //
+ *************** static int packet_consumer(int argc, cha
+ *** 302,310 ****
+ --- 307,330 ----
+             lnp_addressing_write(&acknowledge,1,packet_src,0);
+           }
+           break;
+ +       case CMDgetlog:
+ +      {
+ +         lnp_addressing_write(&acknowledge,1,packet_src,0);
+ +        /* only dump the log if no programs are running */
+ +        if (nb_tasks <= nb_system_tasks) {
+ +            cputs("dump");
+ +            dump_log((int)buffer_ptr[1]);
+ +             cls();
+ +        }
+ +        else
+ +            cputs("err");
+ +         sleep(1);
+ +      }
+ +      break;
+
+         default:
+           debugs("error");
+ +         sleep(1);
+         }
+       }
+     }
+ *************** void program_init() {
+ *** 657,662 ****
+ --- 677,683 ----
+   void program_shutdown() {
+     lnp_addressing_set_handler(0,LNP_DUMMY_ADDRESSING);
+     sem_destroy(&packet_sem);
+ +   sem_destroy(&log_sem);
+
+   #ifdef CONF_LR_HANDLER
+     lr_shutdown();



Message is in Reply To:
  data recording in BrickOS ?
 
Hi Mindstormers, 1) Does BrickOS allow to write/read measured data into the RCX memory, in order to plot or process it later on the computer ? If yes, what are the command lines to : - allocate the memory space ? - to write and read ? - free this (...) (19 years ago, 26-Sep-05, to lugnet.robotics.rcx)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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