Open philippcla opened 8 years ago
Work around for the moment is to use read_imu()
note the _ which gives direct access to the cpp function. The cpp function returns time in the first column and the others as is from the second on to the seventh. (See ?read_imu
for more details.)
Okay, would something along the lines of embedding the time information in the rowname of the matrix be acceptable?
e.g.
a = matrix(c(1,0,0,1), nrow = 4)
# No names
a
[,1]
[1,] 1
[2,] 0
[3,] 0
[4,] 1
# Fake times
rownames(a) = c(.3,.5,.6,.7)
# Named
a
[,1]
0.3 1
0.5 0
0.6 0
0.7 1
## I'll write a better handler (e.g. imu_time() ) to get this info.
# Extract times for manipulation
times = as.numeric(rownames(a))
times*2
0.6 1.0 1.2 1.4
@philippcla Thoughts on the above? Would the proposed change be okay on your end?
Yes
Once I have the indexes of the desired timespan (e.g. indexes 456
through 9857643
, because I want to treat only data between two specific timestamps) can I apply it on the IMU dataset?
original_imu_data = read.imu(file = imu.file_path , type = imu.type)
cutted_imu_data = original_imu_data[indexes,]
I keep the original, and will create a truncated dataset thanks to the indexes-vector... Is this possible?
@philippcla Yes. You can subset under the current imu
structure exactly like a matrix.
original_imu_data = read.imu(file = imu.file_path , type = imu.type)
cutted_imu_data = original_imu_data[456:9857643,]
Per ddd7327, we have:
original_imu_data = read.imu(file = imu.file_path , type = imu.type)
imu_time(original_imu_data)
(Might need to tweak print output to avoid renaming rownames in the presence of pre-assigned names.)
Hello, by using the "imu.data = read.imu(file = imu.file_path , type = imu.type);" the data is assembled in 6 collums being Gyro.X, Gyro.Y, Gyro.Z, Accel.X, Accel.Y and Accel.Z. That is ok. BUT there is no column with the time data. it should look like the following Time [s]\ - GX - GY - GZ - AX - AY - AZ
so it would be 7 columns