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

Collecting sensors data from RecordData #4793

Open
tanyaspaul opened this issue Feb 15, 2023 Discussed in #4784 · 0 comments
Open

Collecting sensors data from RecordData #4793

tanyaspaul opened this issue Feb 15, 2023 Discussed in #4784 · 0 comments

Comments

@tanyaspaul
Copy link

Discussed in #4784

Originally posted by tanyaapaul January 28, 2023
Hello,

I was wondering if anyone had tips towards the integregration of the sensors data in the : airsim_rec.txt file.
I have tried to implement it by following the instructions from : https://microsoft.github.io/AirSim/modify_recording_data/

However the airsim_rec.txt file still does not integrate the sensors data. I am wondering if anyone has advice or other test suggestion to try to integrate it.

Any suggestion would be helpful,
Thanks so much


Implemented the following based on the documentation but did not work for me:
`// MultirotorPawnSimApi.cpp
std::string MultirotorPawnSimApi::getRecordFileLine(bool is_header_line) const
{
std::string common_line = PawnSimApi::getRecordFileLine(is_header_line);
if (is_header_line) {
return common_line +
"Latitude\tLongitude\tAltitude\tPressure\tAccX\tAccY\tAccZ\t";
}

const auto& state = vehicle_api_->getMultirotorState();
const auto& bar_data = vehicle_api_->getBarometerData("");
const auto& imu_data = vehicle_api_->getImuData("");

std::ostringstream ss;
ss << common_line;
ss << state.gps_location.latitude << "\t" << state.gps_location.longitude << "\t"
   << state.gps_location.altitude << "\t";

ss << bar_data.pressure << "\t";

ss << imu_data.linear_acceleration.x() << "\t" << imu_data.linear_acceleration.y() << "\t"
   << imu_data.linear_acceleration.z() << "\t";

return ss.str();

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant