Exercise 2.2 Segmentation Fault

@bitcloude ,
It you get your Heading from laser, the answer would be same as what I said regarding Odometry.
In short: You still need to move the robot for 1 second before you can acquire your heading values, else you will get a segmentation fault.
Refer these posts:

Hope I helped!

Regards,
Girish