hi,

yeah i realized that mails arent formatted.. i have included line numbers to the program snippet for reference.
-----------------------------------------------------------------------------------------------------------------
10>  // enable motors
15>  position->data->cmd_enable_motors = 1;

20> // change direction of the bot
25>  position->data->cmd_vel_rot[2] = -1.6; // for ~90° clockwise
30>  position->data->cmd_vel_pos[2] = 0.12; // switch on motor for z-axis
35>  sleep(1); // wait for 1ms
40>  position->data->cmd_vel_rot[2] = 0; // fix this angle/pose
45>  position->data->cmd_vel_pos[2] = 0; // switch off motor for z-axis

50>  // move forward in new direction
55>  position->data->cmd_vel_pos[0] = 1.52; // switch on motor for x-axis
  -----------------------------------------------------------------------------------------------------------------

Q1 : is there a  neater approach to turn the robot. ideally speaking, the commands (30 to 45) shouldnt be used, but commenting them out ddnt move anything :(

-Raman


Jordi <mumismo@gmail.com> wrote:
Monday 22 May 2006 18:31、Raman Agarwal さんは書きました:
> hi once again !
>
> I wish to interface my client programs to Gazebo , using libgazebo
> (by-passing Player). for this i tried my hand at a simple example. I used
> example.world as my world file and wrote a small C program, which could
> turn the Pioneer2d robot clockwise by 90° and then make it move forward in
> the new direction. Everything worked fine but I have a few questions
> regarding it. Following is the relevant snippet of my code :
> ---------------------------------------------------------------------------
>-------------------------------------- // enable motors
> position->data->cmd_enable_motors = 1;
>
> // change direction of the bot
> position->data->cmd_vel_rot[2] = -1.6; // ~90° clockwise
> position->data->cmd_vel_pos[2] = 0.12; // switch on motor for z-axis
> sleep(1); // wait for 1ms
> position->data->cmd_vel_rot[2] = 0; // fix this angle/pose
> position->data->cmd_vel_pos[2] = 0; // switch off motor for z-axis
>
> // move forward in new direction
> position->data->cmd_vel_pos[0] = 1.52; // switch on motor for x-axis
>
> ---------------------------------------------------------------------------
>--------------------------------------
>
> Q1 : is there a neater approach to turn the robot. ideally speaking, the
> highlighted commands shouldnt be used, but commenting them out ddnt move
> anything :(

I can't see what commands are hightlighted.

Pioneer robots works as follows:
cmd_vel_pos[0] is the linear velocity, any direction or I may say along the x
axis of the robot (not the global axis of the world) . The x axis of the
robot will change if you compare it with the x axis of the world when you
rotate your robot. I don't know about how it is the GUI done. Maybe the three
slides are moved because cmd_vel_pos[1] and cmd_vel_pos[2] just do nothing.

position->data->cmd_vel_rot[2] is the rotation velocity of the robot.




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
Playerstage-gazebo mailing list
Playerstage-gazebo@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo


Blab-away for as little as 1/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.