ouster_ros/contains sample code for publishing OS1 data as standard ROS topics
- The visualizer has been tested on ROS Kinetic on Ubuntu 16.04
- additionally requires
ros-kinetic-pcl-ros,ros-kinetic-tf2-geometry-msgsand, optionally,ros-kinetic-rvizfor visualization using ROS
- additionally requires
- The visualizer has been tested on ROS Melodic on Ubuntu 18.04
- additionally requires
ros-melodic-pcl-ros,ros-melodic-tf2-geometry-msgsand, optionally,ros-melodic-rvizfor visualization using ROS
- additionally requires
- In the following instruction steps,
/path/to/ouster_exampleis where you've cloned the repository - Run the following command
export CMAKE_PREFIX_PATH=/path/to/ouster_example - Be sure to source the ROS setup script before building. For example:
source /opt/ros/[kinetic_or_melodic]/setup.bash - Build with
mkdir -p myworkspace/src && cd myworkspace && ln -s /path/to/ouster_example ./src/ && catkin_make -DCMAKE_BUILD_TYPE=Release
- Make sure the OS1 is connected to the network and has obtained a DHCP lease. See section 3.1 in the accompanying software user guide for more details
- In each new terminal for each command below:
- Make sure to source ROS environment with
source /path/to/myworkspace/devel/setup.bashwhere/path/to/myworkspaceis where the path to the workspace directory that was created when building the ROS nodes
- Make sure to source ROS environment with
- To publish ROS topics from a running sensor from within the
ouster_rosdirectory:- Run
roslaunch os1.launch os1_hostname:=<os1_hostname> os1_udp_dest:=<udp_data_dest_ip> lidar_mode:=<lidar_mode> viz:=<viz>where:<os1_hostname>can be the hostname (os1-991xxxxxxxxx) or IP of the OS1<udp_data_dest_ip>is the IP to which the sensor should send data<lidar_mode>is one of512x10,512x20,1024x10,1024x20, or2048x10<viz>is eithertrueorfalse. If true, a window should open and start displaying data after a few seconds
- Run
- To record raw sensor output
- In another terminal instance, run
rosbag record /os1_node/imu_packets /os1_node/lidar_packets - This will save a .bag file of recorded data in that directory
- In another terminal instance, run
- To publish ROS topics from recorded data from withint the
ouster_rosdirectory:- Run
roslaunch os1.launch replay:=true os1_hostname:=<os1_hostname> - In a second terminal run
rosbag play --clock <bagfile> - Note:
os1_nodereads and writes metadata to${ROS_HOME}to enable accurately replaying raw data. By default, the name of this file is based on the hostname of the sensor. The location of this file can be overridden using themetadata:=<path_to_file>flag - If a metadata file is not available, the visualizer will default to
1024x10. This can be overridden with the
lidar_modeparameter. Visualizer output will only be correct if the samelidar_modeparameter is used for both recording and replay
- Run
- To display sensor output using ROS tools (rviz):
- Follow the instructions above for running the example ROS code with a sensor or recorded data
- To visualize output using rviz, run
rviz -d /path/to/ouster_ros/viz.rvizin another terminal - To view lidar intensity/noise/range images, add
image:=trueto either of theroslaunchcommands above
| key | what it does |
|---|---|
o |
Increase point size |
p |
Decrease point size |
m |
Cycle point cloud coloring by z-height / intensity / z-height plus intensity / range |
c |
Cycle color scheme for range image |
shift c |
Cycle color scheme for point cloud |
v |
Toggle color cycling in range image |
n |
Display ambient image from the sensor |
r |
Reset camera position |
0 (zero) |
Toggle parallel projection and reset camera |
d |
Cycle through fraction of the window height used for displaying range and intensity image |
- Click and drag rotates the view
- Middle click and drag pans the view
- Scroll adjusts how far away the camera is from the vehicle