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 :(

Q2 : when I execute my program and see the output on the GUI console of Gazebo, I could see the bot rotating by  ~90 but it doesnt move forward in the new direction unless i click on the position control check-box. why do i have to do it ?

Q3 : even when I am changing velocity of 1 motor (in reference to last command in the program snippet provided above), all the three axes-motors get activated by the same value. (i observed in the position control window that the 3 sliders change their positions , when only one of them should have changed )

any thoughts ???

[Researcher Fraunhofer-AIS, Bonn]

Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2/min with Yahoo! Messenger with Voice.