This file was opened on Fri, Oct 09 2015. It is currently 9:44:08 PM.
The IMU sensor contains a variety of sensors and is therefore crucial to having a robot… [continue]
Here are the libraries that were installed for this r program. The “data. table”" library helps us organize our data, and the “tidyr” and “dplyr” libaries help us process and analyze our data more efficiently.
library(data.table)
library(tidyr)
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following objects are masked from 'package:data.table':
##
## between, last
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Here, we decided to rename our sensor names as well as the “Time”" variable for convenience during the analysis of the data.
fixSensorNames = function(zte, prefixName) {
setnames(zte, "Euler H", paste0(prefixName, "eulerh"))
setnames(zte, "Euler P", paste0(prefixName, "eulerp"))
setnames(zte, "Euler R", paste0(prefixName, "eulerr"))
setnames(zte, "Time (ms)", paste0(prefixName, "time"))
setnames(zte, "Linear Acceleration X", paste0(prefixName, "accelx"))
setnames(zte, "Linear Acceleration Y", paste0(prefixName, "accely"))
setnames(zte, "Linear Acceleration Z", paste0(prefixName, "accelz"))
}
The r code here reads the excel data file and converrts the time to 100ms. The code here also gets the sensor data and the time ready to be joined into a data table for analysis.
setwd("C:/Users/Simon/Documents/R/Data")
imu = fread("imu_data.csv")
fixSensorNames(imu, "i.")# convert epoch time to 100ms, prepare to join
Before proceeeding to further analysis, we first decided to get a summary of the data in order to get a rough idea of what our data table is like.
summary(imu)
## i.time i.eulerh i.eulerp i.eulerr
## Min. : 0 Min. : 0.0 Min. :-153.000 Min. :-81.00
## 1st Qu.: 8478 1st Qu.:197.0 1st Qu.: -67.000 1st Qu.:-48.00
## Median :16955 Median :241.0 Median : 0.000 Median :-23.00
## Mean :16955 Mean :225.3 Mean : 1.835 Mean :-24.87
## 3rd Qu.:25433 3rd Qu.:291.0 3rd Qu.: 86.000 3rd Qu.: 2.00
## Max. :33910 Max. :359.0 Max. : 87.000 Max. : 14.00
## i.accelx i.accely i.accelz Quaternion W
## Min. :-10.0000 Min. :-51.000 Min. :-28.000 Min. : 0.0
## 1st Qu.: -1.0000 1st Qu.: -9.000 1st Qu.: -4.000 1st Qu.:407.0
## Median : 0.0000 Median : 0.000 Median : -2.000 Median :711.0
## Mean : 0.1424 Mean : -1.498 Mean : -1.331 Mean :647.7
## 3rd Qu.: 1.0000 3rd Qu.: 6.000 3rd Qu.: 1.000 3rd Qu.:956.0
## Max. : 13.0000 Max. : 47.000 Max. : 26.000 Max. :991.0
## Quaternion X Quaternion Y Quaternion Z Max Read Interval
## Min. :-949 Min. : 0.0 Min. :-31.0 Min. : 4.169
## 1st Qu.:-885 1st Qu.:336.0 1st Qu.:177.8 1st Qu.:30.315
## Median :-573 Median :755.5 Median :650.0 Median :30.315
## Mean :-521 Mean :646.7 Mean :547.6 Mean :29.659
## 3rd Qu.:-232 3rd Qu.:919.0 3rd Qu.:863.0 3rd Qu.:30.315
## Max. : 134 Max. :970.0 Max. :970.0 Max. :30.914
## Average Read Interval
## Min. : 0.008143
## 1st Qu.:10.454268
## Median :14.033233
## Mean :12.375019
## 3rd Qu.:15.573770
## Max. :15.877986
Next, we took the standard deviation and mean of the data.
mean(imu$i.eulerh)
## [1] 225.2624
sd(imu$i.eulerh)
## [1] 99.13568
mean(imu$i.eulerp)
## [1] 1.834611
sd(imu$i.eulerp)
## [1] 74.24259
mean(imu$i.eulerr)
## [1] -24.86704
sd(imu$i.eulerr)
## [1] 29.33657
mean(imu$i.accelx)
## [1] 0.1423939
sd(imu$i.accelx)
## [1] 2.40381
mean(imu$i.accely)
## [1] -1.497642
sd(imu$i.accely)
## [1] 18.18913
mean(imu$i.accelz)
## [1] -1.331368
sd(imu$i.accelz)
## [1] 6.135536
Below is the graph of the IMU data. [describe data]
Based on… [write this]