Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Set Pointcloud from log
Description: In this tutorial we use a log folder from active scene recognition which contains a pointcloud which has been used during the process.Tutorial Level: BEGINNER
Contents
Description
In this tutorial we use a log folder from active scene recognition which contains a pointcloud which has been used during the process.
Setup
make sure you have a log folder in ~/log/{date} which contains a "PointCloud" folder. To save pointclouds during scene recognition make sure the !SavePointClouds parameter is set to true in asr_state_machine.
Alternatively download PointCloud _0 and Viewports_0 to ~/PointCloud.
- run the whole simulation using rosrun asr_resources_for_active_scene_recognition start_modules_sim.sh.
make sure all modules are working, the tmux "control" window should show the python repl prompt ">>>".
Tutorial
now run in the control window getPCAndViewportsFromLog({location to logfolder}, 0), make sure the path is absolute, since "~" is not expanded, the second parameter "0" specifies the pointcloud that should be taken, 0 is the first, 1 the second and so on. Make sure those pointcloud files exist in ~/log/{date}/PointCloud/PointCloud_{idx}, if using another idx value. If you use the downloaded pointcloud, use "/home/{username}/" (absolute path to home directory) as {location to logfolder}.
- Now we have a pointcloud including hypotheses and viewports in a 2-tuple from a previous scene recognition, which consists of a lot of poses. To send this stuff to the nbv and to visualize it run setPCAndViewportsFromLog({location to logfolder}, 0) or setPC(*getPCAndViewportsFromLog({location to logfolder}, 0)), which is basically the same as before with a "set" instead of a "get" or we give it expanded to the setPC function.
- Now you should see the pointcloud in rviz. To see the frustum in rviz, go to the ptu_mock tmux window and repeat the last command of the lower right terminal (use your arrow-up key to get the command and press enter). After a few seconds you should be able to see the frustum.