Quantcast

playerc error : got NACK from request

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

playerc error : got NACK from request

Javaid Iqbal
I am compiling following program, which compiles correctly but when i run it, it gives me following error. I have tried to look into FAQ's but no satisfactory answer is available. Apart from this other programs like laserobstacleavoid is running perfectly fine on my system.

lab@lab-desktop:~/javaid$ ./ex1
calling connect
done
playerc error   : got NACK from request
playerc error   : failed to get response
lab@lab-desktop:~/javaid$

Thanks for the help


 #include <stdio.h>
#include <libplayerc/playerc.h>

int
main(int argc, const char **argv)
{
  // Define the global structs/vars
  int i;
  playerc_client_t *client;
  playerc_position2d_t *position2d;
  playerc_sonar_t *sonar;



  // Create a client and connect it to the server.
  client = playerc_client_create(NULL, "localhost", 6665);
  if (0 != playerc_client_connect(client))
    return -1;

  // Create and subscribe to a position2d device.
  position2d = playerc_position2d_create(client, 0);
  if (playerc_position2d_subscribe(position2d, PLAYER_OPEN_MODE))
    return -1;

  // Create and subscribe to a sonar device.
  sonar = playerc_sonar_create(client, 0);
  if (playerc_sonar_subscribe(sonar, PLAYER_OPEN_MODE))
    return -1;


 while (position2d->px < 10.00 )
  {
    // Wait for new data from server
    playerc_client_read(client);


    if (sonar->scan[0] > 2.0 && sonar->scan[1] > 2.0)         
    playerc_position2d_set_cmd_vel(position2d, 0.5,0.5, DTOR(0.0), 1);

    else  
      playerc_position2d_set_cmd_vel(position2d, -0.1,-0.1, DTOR(1000.0), 1);



  }

  // Shutdown
  playerc_position2d_unsubscribe(position2d);
  playerc_position2d_destroy(position2d);

  playerc_sonar_unsubscribe(sonar);
  playerc_sonar_destroy(sonar);

  playerc_client_disconnect(client);
  playerc_client_destroy(client);

  return 0;
}



Kind Regards,


Javaid Iqbal
UNSW, Australia
http://www.ceme.edu.pk/nerc/

 




Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: playerc error : got NACK from request

Austin Stanhope
Are you running this in stage or on a robot?  Post your cfg file.  Most
of the time I get that error is because of the cfg files changing from
the 1.6.5 to the 2.0.3 update.

-Austin

Javaid Iqbal wrote:

> I am compiling following program, which compiles correctly but when i
> run it, it gives me following error. I have tried to look into FAQ's
> but no satisfactory answer is available. Apart from this other
> programs like laserobstacleavoid is running perfectly fine on my system.
>
> lab@lab-desktop:~/javaid$ ./ex1
> calling connect
> done
> playerc error   : got NACK from request
> playerc error   : failed to get response
> lab@lab-desktop:~/javaid$
>
> Thanks for the help
>
>
>  #include <stdio.h>
> #include <libplayerc/playerc.h>
>
> int
> main(int argc, const char **argv)
> {
>   // Define the global structs/vars
>   int i;
>   playerc_client_t *client;
>   playerc_position2d_t *position2d;
>   playerc_sonar_t *sonar;
>
>
>
>   // Create a client and connect it to the server.
>   client = playerc_client_create(NULL, "localhost", 6665);
>   if (0 != playerc_client_connect(client))
>     return -1;
>
>   // Create and subscribe to a position2d device.
>   position2d = playerc_position2d_create(client, 0);
>   if (playerc_position2d_subscribe(position2d, PLAYER_OPEN_MODE))
>     return -1;
>
>   // Create and subscribe to a sonar device.
>   sonar = playerc_sonar_create(client, 0);
>   if (playerc_sonar_subscribe(sonar, PLAYER_OPEN_MODE))
>     return -1;
>
>
>  while (position2d->px < 10.00 )
>   {
>     // Wait for new data from server
>     playerc_client_read(client);
>
>
>     if (sonar->scan[0] > 2.0 && sonar->scan[1] > 2.0)        
>     playerc_position2d_set_cmd_vel(position2d, 0.5,0.5, DTOR(0.0), 1);
>
>     else  
>       playerc_position2d_set_cmd_vel(position2d, -0.1,-0.1,
> DTOR(1000.0), 1);
>
>
>
>   }
>
>   // Shutdown
>   playerc_position2d_unsubscribe(position2d);
>   playerc_position2d_destroy(position2d);
>
>   playerc_sonar_unsubscribe(sonar);
>   playerc_sonar_destroy(sonar);
>
>   playerc_client_disconnect(client);
>   playerc_client_destroy(client);
>
>   return 0;
> }
>
>
>
> Kind Regards,
>
>
> _*Javaid Iqbal*_
> UNSW, Australia
> http://www.ceme.edu.pk/nerc/
>
>  
>
>
>
> ------------------------------------------------------------------------
> Looking for a deal? Find great prices on flights and hotels
> <http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20->
> with Yahoo! FareChase.
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Playerstage-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-users
>  


--
Austin Stanhope                      www.cse.unr.edu/~stanhope
Robotics Research                    www.cse.unr.edu/~society
Computer Science and Engineering     www.cse.unr.edu
University of Nevada, Reno           www.unr.edu

Abuse it and you'll lose it.  I WILL Procmail you.
Think before you click that forward button.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: playerc error : got NACK from request

codelock
My error..
playerc warning   : warning : [Player v.3.0.2] connected on [localhost:6665] with sock 3

playerc error   : got NACK from request
playerc error   : failed to get response
CameraProxy::CameraProxy()(-1) : could not subscribe



My cfg file

# load the Stage plugin simulation driver
driver
(
  name "stage"
  provides [ "simulation:0" ]
  plugin "stageplugin"

  # load the named file into the simulator
  worldfile "simple.world"
)

# Create a Stage driver and attach position2d and laser interfaces
# to the model "r0"
driver
(
  name "stage"
  provides [ "position2d:0" "ranger:0" "ranger:1" ]
  model "r0"
)


Using Stage 4.0.0

Please Help!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: playerc error : got NACK from request

Rich Mattes-2



On Wed, Jun 12, 2013 at 2:49 AM, codelock <[hidden email]> wrote:
My error..
playerc warning   : warning : [Player v.3.0.2] connected on [localhost:6665]
with sock 3

playerc error   : got NACK from request
playerc error   : failed to get response
CameraProxy::CameraProxy()(-1) : could not subscribe



My cfg file

# load the Stage plugin simulation driver
driver
(
  name "stage"
  provides [ "simulation:0" ]
  plugin "stageplugin"

  # load the named file into the simulator
  worldfile "simple.world"
)

# Create a Stage driver and attach position2d and laser interfaces
# to the model "r0"
driver
(
  name "stage"
  provides [ "position2d:0" "ranger:0" "ranger:1" ]
  model "r0"
)


Using Stage 4.0.0

Please Help!
 
You are not simulating a camera, so there is nothing for the CameraProxy to connect to.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: playerc error : got NACK from request

codelock
ok... removed Camera Proxy error but first two lines error still remain
Loading...