Clear Filters
Clear Filters

Ouster OS1 With ROS in MatLab

11 views (last 30 days)
C R
C R on 18 Feb 2020
Commented: C R on 18 Feb 2020
We have been playing with an Ouster OS1, and we would like to try to get access to the raw data stream in real-time in MatLab with the idea to evaluate the map building and other tools in ROS. We are not familiar with ROS, and can't find a lot of exmaples with hardware, so we are hoping the answer here will help others also.
So far, we have built a custom message format using the details here along with the .msg and .srv files with the directories from the Ouster ROS GitHub.
Now, if we check the ROS message list:
rosmsg('list')
We see new message types of:
ouster_ros/OS1ConfigSrvRequest
ouster_ros/OS1ConfigSrvResponse
ouster_ros/PacketMsg
With the custom ROS OS1 messages now available (we know the format of the PacketMsg for the LIDAR and IMU msg topics), we start a ROS master using:
rosinit
This starts a local ROS master on our local machine in MatLab. This is where we are stuck.
We want to create a node for the OS1 using the custom message types and make a LIDAR and IMU topic, and then have the LIDAR and IMU topics sent to the ROS master and make them available.
For our example, the Ouster OS1 has an IP of 192.168.1.100 and ports of 7501 for TCP commands, 7502 for the LIDAR output stream, and 7503 for the IMU output stream. The computer with MatLab has a ROS master IP of 192.168.1.101.
Any help pointing us in the right direction to make a node for the OS1 to send LIDAR and IMU data to the MatLab host and an example of reading the messages would be exellent, thanks to anyone who might be able to help.
  1 Comment
C R
C R on 18 Feb 2020
We should also mention, we have tried to create a node for the OS1 linked to the master, have it publish its data in the Ouster msg format created above, and then have the master subscribe to those topics this way:
% Make a node for the OS1:
OS1Node = ros.Node('/os1_node','192.168.1.101','NodeHost','192.168.1.100');
% Publish ROS LIDAR Topic:
OS1LIDARPub = rospublisher('/os1_node/lidar_packets','ouster_ros/PacketMsg');
% Publish ROS IMU Topic:
OS1IMUPub = rospublisher('/os1_node/imu_packets','ouster_ros/PacketMsg');
% Subscribe to the Topics:
OS1LIDARSub = rossubscriber('/os1_node/lidar_packets');
OS1IMUSub = rossubscriber('/os1_node/imu_packets');
Here, the MatLab computer with the ROS master running in MatLab is 192.168.1.101 and the Ouster OS1 is 192.168.1.100, as above.
While the code executes, it seems the messags aren't being pushed to the subscribers.
Again, thanks for any help and suggestions.

Sign in to comment.

Answers (0)

Tags

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!