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
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to