First it's important to compile the packages.
catkin_make
source devel/setup.bash
Now we have to upload the skectch of arduino named ROS_PUB.
Once uploaded the sketch , we have to launch the main.launch located in the rviz_visual package Copy this command in your terminal:
roslaunch rviz_visual main.launch
After that we'll see the RVIZ interface and the pointcloud.
Then we can accumulate the pointcloud while the servo is rotating , we will send 180 messages by each degree. To use the laser_assemble we have to put this in the terminal , but don' forget to put the following command everytime you use a new terminal.
source devel/setup.bash
Then we call to the service assemble_scans2 with the following command:
roslaunch rviz_visual get_cloud.launch
After that we have to change the topic of the pointcloud for "/cloud_data". Now we can see the points that we generate when the servo of the robot was rotating.
We can create a topic that subscribes to our pointcloud assemble , then we can ignore some points with the variable resample , while the resample is bigget than befores , we will have less points. Lets's see that. Open another terminal and copy the following command:
roslaunch rviz_visual cloud_reduction.launch
Then let's change the topic of the pointcloud on rviz.
Previously I had a PointCloud2 publisher we a lot of bugs , I couldn't control the points for that I create a list we the values in float32 (value 7). When you launch a laser_assemble service server you should have a fixed_frame of reference , maybe the base_link. To change the value of resample you have to enter to the src folder and then open the pointcloud_reduction.py and change the value of the variable of paso_resample.