Skip to content

Commit

Permalink
Don't recalculate timing offsets in inner loop
Browse files Browse the repository at this point in the history
Moving the timing offset calculation up one loop has no effect on the
results, since it depends on the packet, but not any specific block.
  • Loading branch information
odsod committed Aug 6, 2019
1 parent 7d66528 commit ee27c17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spherical_point_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ type SphericalPoint struct {
func (s *SphericalPointCloud) UnmarshalPacket(packet *Packet) {
// duration is in nanoseconds and Velodyne timestamp in microseconds
s.Timestamp = time.Duration(packet.Timestamp) * time.Microsecond
timingOffsets := calculateTimingOffset(packet.ReturnMode)
for i := range packet.Blocks {
block := &packet.Blocks[i]
azimuth := block.Azimuth
timingOffsets := calculateTimingOffset(packet.ReturnMode)
for j := range block.Channels {
channel := &block.Channels[j]
if j == 16 {
Expand Down

0 comments on commit ee27c17

Please sign in to comment.