Dear Rehman and Player/Stage users,

Have you used any special parameters in your *.cfg file? Or any special compilation flags for Player or Stage?
I'm trying to get simulated actuators working without any success.
I have tried your code, and my actuator is not moving at all (you have reported that "the actuator spins 180-degrees as it should").

However Player starts without any problems and reports correct mapping: 6665.actarray.0 is "rob1.actuator:0". As well client successfully connects to Player and sends commands to actuator (I have tried playerv and self-made client). Reading data from ActArrayProxy shows, that actuator has speed value, but position is always 0.

I'm using Player v.3.0.2 and Stage Stage 3.2.2.
I would be grateful for any advice.

Best regards,
Vitalijs

My code is as follows:

.world file contains:
define robot_base position (
  size [ 1.2 0.5 0.5 ]
 
  actuator (
    laser ()
   
    type "rotational"
    axis [0.0 0.0 1.0]
    min_position 0
    max_position 6
    max_speed 0.5
    size [0.1 0.1 1.0]
    color "green"
    pose [-0.1 0.0 -0.4 0.0 ]   
  )
)

.cfg file
driver
(       
  name "stage"
  provides [ "simulation:0" ]
  plugin "stageplugin"

  worldfile "actuator.world"   
)

driver
(
  name "stage"
  provides [ "6665:position2d:0" "6665:actarray:0" "6665:laser:0"]
  model "rob1"
)

client code
#include <cstdlib>

#include <libplayerc++/playerc++.h>
#include <unistd.h>
#include <iostream>
#include <math.h>

int main(int argc, char** argv) {
    using namespace std;
    using namespace PlayerCc;

    try {
        PlayerClient robot("localhost");
        LaserProxy laser(&robot, 0);
        ActArrayProxy act(&robot, 0);
 
        robot.Read();
        act.MoveTo(0, 0.0);

        while (true) {
            robot.Read();
 
            act.MoveTo(0, 6.0);
            //act.MoveAtSpeed(0, 1.0); 
          
            cout << "================================" << endl;
            cout << "Count:" << act.GetCount() << endl;
            cout << "Pos: " << act[0].position << endl;
            cout << "Speed: " << act[0].speed << endl;
            cout << "Accel: " << act[0].acceleration << endl;

            sleep(1);
        }     
    } catch (PlayerError e) {
        return -1;
    }

    return 0;
}

2010/5/18 Rehman Merali <rsmerali@gmail.com>

I'm still having this issue where the actuator randomly spins around in
Stage-3.1.0. I can't get actarray to work in Stage-3.2.0 or 3.2.2, so I
don't know if it has been resolved. Note that I have also updated to
Player-3.0.1.
Below is the minimal client code that illustrates the problem.

Thank you,
Rehman


#include <math.h>

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

int main(int argc, char** argv)
{
       using namespace std;
       using namespace PlayerCc;

       try
       {
               PlayerClient robot("localhost");
               ActArrayProxy pz(&robot, 0);
               pz.MoveTo(0,0);
               for(int i = 1; i < 100; i++){
                       robot.Read(); //Actuator is still
               }
               pz.MoveTo(0,M_PI);
               for(int i = 1; i < 1000; i++){
                       robot.Read(); //Actuator sporadically spins 360-degrees
               }
       }
       catch (PlayerError e)
       {
               return -1;
       }

       return 0;
}



Rehman Merali wrote:
>
> I'm running Player 2.1.2 and Stage 3.1.0 on Ubuntu 9.04.
>
> My .world file has:
>
> pioneer2dx
> (
>   name "pioneer"
>
>   pose [ 0 0 0 0 ]
>
> actuator
> (
>   sicklaser()
>   # actuator properties
>   type "rotational"
>   axis [0 0 1]
>
>   min_position 0
>   max_position 6.2835
>   #max_speed 0.5
>   max_speed 1.0
>   color "green"
>   size [ 0.22 0.19 0.19 ]
> )
>
>   localization "odom"
> )
>
>
> My client has:
>
> ActArrayProxy pz(&robot, 0);
>
> And "pz.MoveTo(0,0);" works fine. But when I use "pz.MoveTo(0,M_PI);", the
> actuator spins 180-degrees as it should, but if I just do nothing for a
> while (i.e. delay), the actuator will spin 360-degrees and return to M_PI.
> As I continue to delay, it will just spin around every once in a while.
> After a long delay, I issue "pz.MoveTo(0,0);", and it returns to 0 and
> stays there as I delay some more (random spinning does not occur).
>
> I've tried various things like trying to stop it once it reaches M_PI by
> issuing "pz.MoveAtSpeed(0, 0);", but it does not help.
>
>
> Please help,
> Rehman
>
>
>
>

--
View this message in context: http://old.nabble.com/Actarray-actuator-problem-in-Stage-3.1.0-tp25531385p28599697.html
Sent from the playerstage-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------

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