Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADIS16470 fixes. #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/adis16470.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ int Adis16470::read_register(char address, int16_t& data)
if (size !=3)
{
perror("read");
return -1;
}
data = big_endian_to_short(&buff[1]);
return 0;
}

/**
Expand Down Expand Up @@ -301,8 +303,8 @@ int Adis16470::update_burst(void)
perror("update_burst");
return -1;
}
size = read(fd_, buff, 30);
if (size != 30)
size = read(fd_, buff, 24);
if (size != 24)
{
perror("update_burst");
return -1;
Expand All @@ -320,13 +322,13 @@ int Adis16470::update_burst(void)
// Z_GYRO_OUT
gyro[2] = big_endian_to_short(&buff[9]) * M_PI / 180 / 10.0;
// X_ACCL_OUT
accl[0] = big_endian_to_short(&buff[11]) * M_PI / 180 / 10.0;
accl[0] = big_endian_to_short(&buff[11]) * 9.8 * 40.0 / 32000.0;
// Y_ACCL_OUT
accl[1] = big_endian_to_short(&buff[13]) * M_PI / 180 / 10.0;
accl[1] = big_endian_to_short(&buff[13]) * 9.8 * 40.0 / 32000.0;
// Z_ACCL_OUT
accl[2] = big_endian_to_short(&buff[15]) * M_PI / 180 / 10.0;
accl[2] = big_endian_to_short(&buff[15]) * 9.8 * 40.0 / 32000.0;
// TEMP_OUT
temp = big_endian_to_short(&buff[16]) * 0.1;
temp = big_endian_to_short(&buff[17]) * 0.1;
return 0;
}

Expand Down Expand Up @@ -376,7 +378,7 @@ int Adis16470::set_bias_estimation_time(int16_t tbc)
int16_t dummy = 0;
read_register(0x66, dummy);
read_register(0x00, tbc);
ROS_INFO("TBC: %04x", tbc);
fprintf(stdout, "TBC: %04x", tbc);
return 0;
}

Expand Down