Main Content

rosReadScanAngles

Return scan angles from ROS or ROS 2 message structure

Since R2021a

Description

angles = rosReadScanAngles(scan) calculates the scan angles, angles, corresponding to the range readings in the ROS or ROS 2 laser scan message structure, scan. Angles are measured counterclockwise around the positive z-axis, with the zero angle along the x-axis. The angles is returned in radians and wrapped to the [ –pi, pi] interval.

Input Arguments

collapse all

ROS or ROS 2 laser scan message of type 'sensor_msgs/LaserScan', specified as a message structure.

Output Arguments

collapse all

Scan angles for laser scan data, returned as an n-by-1 matrix in radians. Angles are measured counter-clockwise around the positive z-axis, with the zero angle along the x-axis. The angles is returned in radians and wrapped to the [ –pi, pi] interval.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2021a