Instructions for getting Lidar Data into ROS
===
### Open this webpage
[Open This Page and clone the Repo](https://github.com/Unity-Technologies/Unity-Robotics-Hub)
Navigate to tutorials/ros_unity_integration in the downloaded repo.
```bash
docker build -t melodic -f ros_docker/Dockerfile .
```
After building, run the container.
```bash
docker run -it --rm --net ros -p 10000:10000 melodic /bin/bash
```
Inside this docker run this command
**roscore**
Copy the ROS_MASTER_URI , which will appear after the command !!
```bash
SUMMARY
========
PARAMETERS
* /rosdistro: melodic
* /rosversion: 1.14.13
NODES
auto-starting new master
process[master]: started with pid [69]
ROS_MASTER_URI=http://5199050c4b88:11311/
setting /run_id to 56442d4e-0dc0-11ed-b2c2-0242ac120002
process[rosout-1]: started with pid [80]
started core service [/rosout]
```
I have given data in bagfiles , bring it inside the container. I have mapped my present working directory to home inside the container.
In another terminal open another docker container
```bash
docker run -it --rm --net ros --volume=/tmp/.X11-unix:/tmp/.X11-unix --volume=/home/${USER}/:/mnt/data --volume=/tmp/compositor:/tmp/compositor/ --volume=$(pwd):/home -p 10001:10000 --env ROS_MASTER_URI=http://ebf3a4b978f8:11311/ melodic /bin/bash
```
**Replace the ROS_MASTER_URI in above command with your own**
command
```bash
source devel/setup.bash
roslaunch ros_tcp_endpoint endpoint.launch
```
Third Terminal 3
**Replace the ROS_MASTER_URI in above command with your own**
```bash
docker run -it --rm --net ros --volume=/tmp/.X11-unix:/tmp/.X11-unix --volume=/home/${USER}/:/mnt/data --volume=/tmp/compositor:/tmp/compositor/ --volume=$(pwd):/home -p 10002:10000 --env ROS_MASTER_URI=http://ebf3a4b978f8:11311/ melodic /bin/bash
```
Now navigate to folder inside bagfiles.
it contains lidar.bag , which is lidar data.
```bash
rosbag play -l lidar.bag
```
[Now Follow this page](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/ros_unity_integration/setup.md)
And Look at Unity Setup !!
Pls use Unity