Hi,

Well here are my debug messages, seems to be something related to the laser configuration transfer as Jimmy mentioned (time delay maybe?)

 
** SERVER SIDE **
user@server ~ $ player -p 7777 -d 3 lms200.cfg
** Player v1.6.5 **[Port 7777]
* Part of the Player/Stage Project [http://playerstage.sourceforge.net].
* Copyright 2000-2005 Brian Gerkey, Richard Vaughan, Andrew Howard,
* Nate Koenig and contributors.
* Released under the GNU General Public License.
Startup options: [TCP]

Parsing configuration file "lms200.cfg"
Using device table:
------------------------------------------------------------
driver sicklms200 provides 7777:laser:0
------------------------------------------------------------
listening on ports: 7777
** Player [port 7777] client accepted from 1xx.xx.xx.xx on socket 7 **
warning : not allowing subscription to unknown device "7777:position:0"
Laser initialising (/dev/tts/USB0)
connecting at 38400
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
connecting at 9600
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
connecting at 38400
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
sending configuration mode request to laser
waiting for acknowledge
warning : timeout
error   : unable to connect to laser
** Player [port 7777] killing client on socket 7 **



** CLIENT SIDE ***
 
user@client ~ mydir$ ./laserobstacleavoid -p 7777 -h server
WARNING: tried to get 'w' access to device 7777:4:0 but got 'e' access.
WARNING: tried to get 'r' access to device 7777:6:0 but got 'e' access.
Player v.1.6.5
can't read from laser


** MY CLIENT CODE **
int main(int argc, char **argv)
{
  double minR, minL;

  parse_args(argc,argv);

  //  playerc_client_t *client;
  //  playerc_position_t *position;


  PlayerClient robot(host,port);
  PositionProxy pp(&robot,device_index,'w');
  LaserProxy lp(&robot,device_index,'r');

//  client = playerc_client_create(NULL, host, port);  // RWI

  printf("%s\n",robot.conn.banner);
/*
if (playerc_client_connect(client) != 0)  // RWI
{
 cerr << "error: " << playerc_error_str() << endl;
 return -1;
}

  position = playerc_position_create(client, 0);   // RWI
  if (playerc_position_subscribe(position, 'a') != 0)
   {
    fprintf(stderr, "error: %s\n", playerc_error_str());
    return -1;
   }
*/


  if(lp.access != 'r')
    {
      puts( "can't read from laser" );
      exit(-1);
    }

  /* maybe turn on the motors */
  //if(turnOnMotors && pp.SetMotorState(1))
  //exit(1);

  double newspeed, newturnrate;
  /* go into read-think-act loop */
  for(;;)
  {
    /* this blocks until new data comes; 10Hz by default */
//    if(robot.Read())
//      exit(1);

    /* print current sensor data to console */
    lp.Print();
    //pp.Print();

    /*
     * laser avoid (stolen from esben's java example)
     */

    minL=1e9;
    minR=1e9;
    for (int j=0; j<lp.scan_count/2; j++) {
      if (minR>lp[j])
        minR=lp[j];
    }
    for (int j=lp.scan_count/2; j<lp.scan_count; j++) {
      if (minL>lp[j])
        minL=lp[j];
    }
    printf("minR:%.3f\tminL:%.3f\n", minR,minL);
   double l=(1e5*minR)/500-100;
    double r=(1e5*minL)/500-100;
    if (l>100)
      l=100;
    if (r>100)
      r=100;

    newspeed = (r+l)/1e3;

    newturnrate = (r-l);

// Switched MIN->MAX  ***********
    newturnrate = MAX(newturnrate,40);
    newturnrate = MIN(newturnrate,-40);
    newturnrate = DTOR(newturnrate);

//    printf( "speed %f  turn %f\n", newspeed, newturnrate );

    /* write commands to robot */
//    pp.SetSpeed( newspeed, newturnrate );
  }
}



playerstage-users-request@lists.sourceforge.net wrote:
Send Playerstage-users mailing list submissions to
playerstage-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/playerstage-users
or, via email, send a message with subject or body 'help' to
playerstage-users-request@lists.sourceforge.net

You can reach the person managing the list at
playerstage-users-admin@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Playerstage-users digest..."


Today's Topics:

1. LMS-200 problem! (lonche martinela)
2. Re: LMS-200 problem! (Jingshen Jimmy Zhang)

--__--__--

Message: 1
Date: Tue, 27 Dec 2005 07:50:53 +0000 (GMT)
From: lonche martinela
To: playerstage-users@lists.sourceforge.net
Subject: [Playerstage-users] LMS-200 problem!
Reply-To: playerstage-users@lists.sourceforge.net

--0-336977975-1135669853=:1425
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi guys:

I am quite new to Player (V. 1.6.5), so i have been trying some programs but regarding to use the LMS-200 laser range finder it has been failing to connect. I wonder what migth be the problem.

Below you can find the messages displayed by the applications.
My server script is so simple:
driver
(
name "sicklms200"
provides ["laser:0"]
port "/dev/ttyS0"
# delay 0 #or 35, anyway same result
rate 38400
# resolution 25
# range_res 1
)

And the client application when it runs in the local and/or remote host yields the same results.
(in different computers i have got the same problem). Let me highlight that when establishing the connection (Client/Server) the LMS200 green-light switches to red-light, and i have to manually re-initialize the sensor every time

Hope someone could enlighten me! (BTW the laser sensor password was previously reseted with a windows application )

Thank you and regards,

Martinelo


CLIENT SIDE
user@host ~ $ ./laserobstacleavoid -h 1xx.xx.xxx.xx -p 7777
WARNING: tried to get 'r' access to device 7777:6:0 but got 'e' access.
can't read from laser

SERVER SIDE (whatever it be the port, i get same results)

root@mobility:~/mydir# player -p 7777 lms200.cfg
** Player v1.6 ** [Port 7777] [TCP]

Parsing configuration file "lms200.cfg"
Using device table:
------------------------------------------------------------
0 driver sicklms200 id 7777:laser:0
------------------------------------------------------------
listening on port 7777
** Player [port 7777] client accepted from 1xx.xx.xxx.xxx on socket 7 **
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
error : unable to connect to laser
error : no reply from laser
** Player [port 7777] killing client on socket 7 **




Send instant messages to your online friends http://uk.messenger.yahoo.com
--0-336977975-1135669853=:1425
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

 Hi guys:

I am quite new to Player (V. 1.6.5), so i have been trying some programs but regarding to use the LMS-200 laser range finder it has been failing to connect. I wonder what migth be the problem.

Below you can find the messages displayed by the applications.
My server script is so simple:
driver
(
 name "sicklms200"
  provides ["laser:0"]
   port "/dev/ttyS0"
#    delay 0  #or  35, anyway same result
 rate 38400
  # resolution 25
  # range_res 1
)

And the client application when it runs in the local and/or remote host yields the same results.
(in different computers i have got the same problem). Let me highlight that when establishing the connection (Client/Server) the LMS200 green-light switches to red-light, and i have to manually re-initialize the sensor every time

Hope someone could enlighten me!
(BTW the
laser sensor password was previously reseted with a windows application )

Thank you and regards,

Martinelo


CLIENT SIDE
user@host ~ $ ./laserobstacleavoid -h 1xx.xx.xxx.xx -p 7777
WARNING: tried to get 'r' access to device 7777:6:0 but got 'e' access.
can't read from laser

SERVER SIDE (whatever it be the port, i get same results)

root@mobility:~/mydir# player -p 7777 lms200.cfg
** Player v1.6 ** [Port 7777] [TCP]

Parsing configuration file "lms200.cfg"
Using device table:
------------------------------------------------------------
0 driver sicklms200 id 7777:laser:0
------------------------------------------------------------
listening on port 7777
** Player [port 7777] client accepted from 1xx.xx.xxx.xxx on socket 7 **
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
wa
rning :
timeout
warning : timeout
warning : timeout
warning : timeout
warning : timeout
error   : unable to connect to laser
error   : no reply from laser
** Player [port 7777] killing client on socket 7 **


Send instant messages to your online friends http://uk.messenger.yahoo.com
--0-336977975-1135669853=:1425--


--__--__--

Message: 2
Date: Tue, 27 Dec 2005 08:55:53 -0800
From: Jingshen Jimmy Zhang
To: playerstage-users@lists.sourceforge.net
Subject: Re: [Playerstage-users] LMS-200 problem!
Reply-To: playerstage-users@lists.sourceforge.net

Hi~

Looks like your laser starts fine, but the client subscription is
changing the laser configuration. Can you post your client code? And
also run player with '-d 2' or '-d 3' flags (e.g. player -p 7777 -d 3
lms200.cfg) to show more debug messages?

Jimmy


lonche martinela wrote:

> Hi guys:
>
> I am quite new to Player (V. 1.6.5), so i have been trying some
> programs but regarding to use the LMS-200 laser range finder it has
> been failing to connect. I wonder what migth be the problem.
>
> Below you can find the messages displayed by the applications.
> My server script is so simple:
> driver
> (
> name "sicklms200"
> provides ["laser:0"]
> port "/dev/ttyS0"
> # delay 0 #or 35, anyway same result
> rate 38400
> # resolution 25
> # range_res 1
> )
>
> And the client application when it runs in the local and/or remote
> host yields the same results.
> (in different computers i have got the same problem). Let me highlight
> that when establishing the connection (Client/Server) the LMS200
> green-light switches to red-light, and i have to manually
> re-initialize the sensor every time
>
> Hope someone could enlighten me! (BTW the laser sensor password was
> previously reseted with a windows application )
>
> Thank you and regards,
>
> Martinelo
>
>
> CLIENT SIDE
> user@host ~ $ ./laserobstacleavoid -h 1xx.xx.xxx.xx -p 7777
> WARNING: tried to get 'r' access to device 7777:6:0 but got 'e' access.
> can't read from laser
>
> SERVER SIDE (whatever it be the port, i get same results)
>
> root@mobility:~/mydir# player -p 7777 lms200.cfg
> ** Player v1.6 ** [Port 7777] [TCP]
>
> Parsing configuration file "lms200.cfg"
> Using device table:
> ------------------------------------------------------------
> 0 driver sicklms200 id 7777:laser:0
> ------------------------------------------------------------
> listening on port 7777
> ** Player [port 7777] client accepted from 1xx.xx.xxx.xxx on socket 7 **
> warning : timeout
> warning : timeout
> warning : timeout
> warning : timeout
> warning : timeout
> warning : timeout
> warning : timeout
> wa rning : timeout
> warning : timeout
> warning : timeout
> warning : timeout
> warning : timeout
> error : unable to connect to laser
> error : no reply from laser
> ** Player [port 7777] killing client on socket 7 **
>
>
> Send instant messages to your online friends
> http://uk.messenger.yahoo.com
>


--
Jingshen Jimmy Zhang
jimmy.zhang@stanford.edu
balance in life - in all things




--__--__--

_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users


End of Playerstage-users Digest

Send instant messages to your online friends http://uk.messenger.yahoo.com