2016年3月17日星期四

Progress week 12-week 16


1.       用rosbuild编译libuvc_ros,出现错误:no makefile found in…
3.       执行到roslaunch ./camera_node.launch报错:
Error: ERROR: cannot launch node of type [uvc_camera/uvc_camera_node]: can't locate node [uvc_camera_node] in package [uvc_camera]
4.       用之前的catkin_make过的umd_camera来试一下:
$~/dev/catkin_ws/src/camera_umd/uvc_camera/launch$ roslaunch uvc_camera camera_node.launch
输出错误:opening /dev/video0
terminate called after throwing an instance of 'std::runtime_error'
  what():  couldn't open /dev/video0
[uvc_camera-1] process has died [pid 7582, exit code -6, cmd /home/ally/dev/catkin_ws/devel/lib/uvc_camera/uvc_camera_node __name:=uvc_camera __log:=/home/ally/.ros/log/b8523500-e386-11e5-90f2-000c2944263f/uvc_camera-1.log].
log file: /home/ally/.ros/log/b8523500-e386-11e5-90f2-000c2944263f/uvc_camera-1*.log
通过cheese发现我的摄像头是dev/video1不是dev/video0
拔了重新连,变成video0.
输出:
依然有calibration error。但是有输出。
5.       执行rqt命令,使其出现图像。发现其plugin里没有image_view, 遂下载http://wiki.ros.org/rqt/UserGuide/Install/Groovy
6.       安装image_view plugin后再rqt界面中选择/image_raw topic,遂出现:
ASUS Xtion运用3D sensor_msgs/PointCloud  data and most slamming algorithms need 2D  sensor_msgs/LaserScan messages to work properly, we need to find a solution to this issue: depthimage_to_laserscan .
8.       重启mono-slam: ~/catkin_ws2/src/mono-slam/conf$ rosrun mono-slam mo-slam /home/ally/catkin_ws2/src/mono-slam/conf/configuration.cfg /image:=/your_image_topic
输出和以前一样。Rostopic list显示:
/camera/image_raw
/camera_info
/image_raw
/image_raw/compressed
/image_raw/compressed/parameter_descriptions
/image_raw/compressed/parameter_updates
/monoslam/camera
/monoslam/camera_pose
/monoslam/camera_poses
/monoslam/features
/monoslam/imgproc
/monoslam/imgproc/compressed
/monoslam/imgproc/compressed/parameter_descriptions
/monoslam/imgproc/compressed/parameter_updates
/monoslam/quality_index
/monoslam/visual_odometry
/pose
/rosout
/rosout_agg
/tf
/tf_static
9.       想办法弄明白mono-slam的topic的含义。研究http://www.clearpathrobotics.com/guides/ros/ROS%20Navigation%20Basics.html
上关于gmapping和localization等的含义:
move_base allows Jackal to try to reach a goal simply with laser and odometry data. The move_base package provides an implementation of an action (see the actionlibpackage) that, given a goal in the world, will attempt to reach it with a mobile base. The move_base node links together a global and local planner to accomplish its global navigation task. It supports any global planner adhering to the nav_core::BaseGlobalPlanner interface specified in the nav_core package and any local planner adhering to the nav_core::BaseLocalPlanner interface specified in the nav_corepackage. The move_base node also maintains two costmaps, one for the global planner, and one for a local planner (see the costmap_2d package) that are used to accomplish navigation tasks.
10.  目前的topic的订阅和发布图是这样的可以看到mono-slam还没有发布和订阅任何topic,而uvc_camera是发布了image_raw这个topic
11.  运行~/catkin_ws2/src/mono-slam/conf$ rosrun mono-slam mo-slam configuration.cfg /camera/image_raw:=/image_raw,同时运行~/dev/catkin_ws/src/camera_umd/uvc_camera/launch$ roslaunch uvc_camera camera_node.launch,得到
amcl is a probabilistic localization system for a robot moving in 2D. It implements the adaptive (or KLD-sampling) Monte Carlo localization approach (as described by Dieter Fox), which uses a particle filter to track the pose of a robot against a known map.
13.  在实验室可以查看http://wiki.ros.org/turtlebot_navigation,连接turtlebot
14.  安装turtlebot在pc上: sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs
出现报错:有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:下列软件包有未满足的依赖关系:
 ros-indigo-turtlebot-simulator : 依赖: ros-indigo-turtlebot-gazebo 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
15.  尝试sudo apt-get update和sudo apt-get upgrade,进行了一系列更新,但问题没有解决
16.  尝试一个个安装依赖的包:sudo apt-get install gazebo2 libsdformat1 ros-indigo-gazebo-plugins ros-indigo-turtlebot-gazebo然后重试14,安装成功
17.  尝试roslaunch turtlebot_stage turtlebot_in_stage.launch。出现报错:
Invalid <arg> tag: environment variable 'TURTLEBOT_STAGE_MAP_FILE' is not set.

Arg xml is <arg default=" $(env TURTLEBOT_STAGE_MAP_FILE)" name="map_file"/>
The traceback for the exception was written to the log file
原因:没有设置map
尝试roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=~/map.yaml失败。查看turtlebot_gazebo中的其他launch file,可以运行slam_gmapping.
尝试source /opt/ros/indigo/setup.bash后重新roslaunch turtlebot_gazebo turtlebot_world.launch,可以启动gazebo模拟软件:
需要等待一段时间load。
但是没有找到gazebo_playground的launch file.
上的提示打开gmapping demo,得到:
即时的mapping信息,可以通过远程遥控teleoperate看到更多地图。
尝试安装kinect的安装包。显示已安装。运行roslaunch openni_launch openni.launch。执行rqt_graph显示见~/rqt_graph.有depth信息可以订阅。
20.  连接pc usb到turtlebot。根据http://wiki.ros.org/turtlebot/Tutorials/indigo/Create%20Base,执行sudo adduser username dialout。显示:
22.  在turtlebot上运行roslaunch turtlebot_bringup 3dsensor.launch然后运行rosrun image_view 等等
在pc上无法得到image_view 的图像,但是在turtlebot上可以
23.  在本地电脑上尝试rosrun vfh vfh_node成功:
得到topic:

24.  利用stereo.bag不能再rviz上打开camera的message
25.  安装rtabmap包,catkin_make,运行roslaunch rtabmap_ros demo_stereo_outdoor.launch。发现如下错误:
发现stereo.bag已经是发布了points和disparity的信息。
运行rosrun image_view stereo_view stereo:=narrow_stereo image:=image_rect,发现只弹出两个窗口,没有disparity image.
打开rqt用image_view查看,发现只有/stereo_camera/left/image_raw_throttle/compressed和right的那个对应的是有图像的。
当同时打开两个bag时,发现rqt可以显示所有topic的图像,只不过很卡,好像是两个照相机的图片同时显示了。
26.  roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/opt/ros/indigo/share/turtlebot_gazebo/worlds/playground.world
默认playground world
roslaunch turtlebot_rviz_launchers view_navigation.launch
roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/opt/ros/indigo/share/turtlebot_gazebo/maps/playground.yaml
默认playground map
结果:
27.  Stefano replied to VFH:
So we can use it directly.
Note:
This driver may take several seconds to start up, especially on slower machines. You may want to set the 'alwayson' option for vfh to '1' in your configuration file in order to front-load this delay. Otherwise, your client may experience a timeout in trying to subscribe to this device.
The vfh driver implements the Vector Field Histogram Plus local navigation method by Ulrich and Borenstein. VFH+ provides real-time obstacle avoidance and path following capabilities for mobile robots. Layered on top of a laser-equipped robot, vfh works great as a local navigation system (for global navigation, you can layer the wavefront driver on top of vfh).
The primary parameters to tweak to get reliable performance are safety_dist and free_space_cutoff. In general, safety_dist determines how close the robot will come to an obstacle while turning (around a corner for instance) and free_space_cutoff determines how close a robot will get to an obstacle in the direction of motion before turning to avoid. From experience, it is recommeded that max_turnrate should be at least 15% of max_speed.
To get initiated to VFH, I recommend starting with the default values for all parameters and experimentally adjusting safety_dist and free_space_cutoff to get a feeling for how the parameters affect performance. Once comfortable, increase max_speed and max_turnrate. Unless you are familiar with the VFH algorithm, I don't recommend deviating from the default values for cell_size, window_diameter, or sector_angle.
29.  下载player:根据http://blog.csdn.net/adangsmile/article/details/21475429 终止,因为用ros创建package也可以。
30.  尝试下载安装stereo_slam包,安装g2o依赖时网络出错。
31.  发现disparity_image_proc包,来源:https://github.com/skohlbr/disparity_image_proc可以将disparity image转化为depth image
32.  加上之前发现的disparity image 转化为laserscan包:https://github.com/ros-perception/depthimage_to_laserscan
在运行roslaunch turtlebot_gazebo turtlebot_world.launch和roslaunch turtlebot_rviz_launchers view_navigation.launch还有roslaunch turtlebot_gazebo amcl_demo.launch后发现topic里有/scan这个topic,不知道是不是类似于laserScan的topic。
运行rosrun vfh vfh_node后发现rqt的graph是这样的:
可以发现vfh只订阅了/odem的信息,所以不确定是不是要设置一下scan的参数。
尝试rosrun vfh vfh_node /LaserScan:=/scan
发现小机器人仍未移动。没有错误信息但是应该是失败的。
33.  在宿舍成功安装stereo_slam的依赖包。
34.  安装depth_to_laserscan包,发现没有生成target。新建workspace catkin_ws3来编译包,成功。
安装disparity_image_proc包在catkin_ws3中,成功。
35.  尝试map_server发布:
改写VFH_node.h:
改写:vfh_node.cpp
改写VFH_Algorithm.cc:
37.  问ros论坛:
Hi everyone,

Currently I am using the VFH algorithm as a local planning method to navigate the turtlebot in Gazebo simulation. The code was already contributed by https://github.com/morpheus1820/ros-nodes/tree/master/vfh
I ran the command:

    roslaunch turtlebot_gazebo turtlebot_world.launch
    rosrun vfh vfh_node
And discovered the vfh method is not supported by laser scan in the rqt_graph.
![image description](http://)

Rosbag play Mapping1.bag之后:
一直运行。。。
尝试map_server??
运行rosrun image_view stereo_view stereo:=narrow_stereo_textured image:=image_rect: