fix small bugs

sensor side wrong.
round the index to integer