Skip to content
Snippets Groups Projects
Commit cf267bb4 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Updated the IMU example to show gyro data.

parent e7492a99
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ std::string robot_device="/tmp/darwin_driver";
int main(int argc, char *argv[])
{
int i=0;
double accel_x,accel_y,accel_z;
double gyro_x,gyro_y,gyro_z;
try{
CDarwinRobot darwin("Darwin",robot_device,1000000,0x01,true);
......@@ -19,8 +19,8 @@ int main(int argc, char *argv[])
darwin.imu_start();
for(i=0;i<50;i++)
{
darwin.imu_get_accel_data(&accel_x,&accel_y,&accel_z);
std::cout << "Accel: x:" << accel_x << ", y: " << accel_y << ", z: " << accel_z << std::endl;
darwin.imu_get_gyro_data(&gyro_x,&gyro_y,&gyro_z);
std::cout << "Gyro: x:" << gyro_x << ", y: " << gyro_y << ", z: " << gyro_z << std::endl;
usleep(100000);
}
darwin.imu_stop();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment