ROS MEMO
lglgang
lglgang 8787 0
2016-06-14 20:57



ROS


First , install
ubuntu 16.04
http://wiki.ros.org/kinetic


ROS Kinetic Kame is
primarily targeted at the Ubuntu 16.04 (Xenial) release


http://wiki.ros.org/kinetic/Installation


http://wiki.ros.org/kinetic/Installation/Ubuntu


https://help.ubuntu.com/community/Repositories/Ubuntu



Setup your sources.list


sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'


Set up your keys


sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116



Installation


sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full



2,595 MB of
additional disk space will be used


sudo apt install
python-roslaunch


apt-cache search ros-kinetic



sudo rosdep init rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
source /opt/ros/kinetic/setup.bash
sudo apt-get install python-rosinstall

printenv | grep ROS
ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_PACKAGE_PATH=/opt/ros/kinetic/share:/opt/ros/kinetic/stacks
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=kinetic
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
source /opt/ros/kinetic/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
sudo apt-get install tree
catkin_init_workspace
tree
.
└── CMakeLists.txt -> /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake

0 directories, 1 file

cd ~/catkin_ws/
catkin_make

ligang@ligang-Vostro-220-Series:~/catkin_ws$ tree
.
├── build
│   ├── catkin
│   │   └── catkin_generated
│   │       └── version
│   │           └── package.cmake
│   ├── catkin_generated
│   │   ├── env_cached.sh
│   │   ├── generate_cached_setup.py
│   │   ├── installspace
│   │   │   ├── env.sh
│   │   │   ├── setup.bash
│   │   │   ├── setup.sh
│   │   │   ├── _setup_util.py
│   │   │   └── setup.zsh
│   │   ├── order_packages.cmake
│   │   ├── order_packages.py
│   │   ├── setup_cached.sh
│   │   └── stamps
│   │       └── Project
│   │           ├── interrogate_setup_dot_py.py.stamp
│   │           ├── order_packages.cmake.em.stamp
│   │           ├── package.xml.stamp
│   │           └── _setup_util.py.stamp
│   ├── CATKIN_IGNORE
│   ├── catkin_make.cache
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── 3.5.1
│   │   │   ├── CMakeCCompiler.cmake
│   │   │   ├── CMakeCXXCompiler.cmake
│   │   │   ├── CMakeDetermineCompilerABI_C.bin
│   │   │   ├── CMakeDetermineCompilerABI_CXX.bin
│   │   │   ├── CMakeSystem.cmake
│   │   │   ├── CompilerIdC
│   │   │   │   ├── a.out
│   │   │   │   └── CMakeCCompilerId.c
│   │   │   └── CompilerIdCXX
│   │   │       ├── a.out
│   │   │       └── CMakeCXXCompilerId.cpp
│   │   ├── clean_test_results.dir
│   │   │   ├── build.make
│   │   │   ├── cmake_clean.cmake
│   │   │   ├── DependInfo.cmake
│   │   │   └── progress.make
│   │   ├── cmake.check_cache
│   │   ├── CMakeDirectoryInformation.cmake
│   │   ├── CMakeError.log
│   │   ├── CMakeOutput.log
│   │   ├── CMakeRuleHashes.txt
│   │   ├── CMakeTmp
│   │   ├── download_extra_data.dir
│   │   │   ├── build.make
│   │   │   ├── cmake_clean.cmake
│   │   │   ├── DependInfo.cmake
│   │   │   └── progress.make
│   │   ├── doxygen.dir
│   │   │   ├── build.make
│   │   │   ├── cmake_clean.cmake
│   │   │   ├── DependInfo.cmake
│   │   │   └── progress.make
│   │   ├── feature_tests.bin
│   │   ├── feature_tests.c
│   │   ├── feature_tests.cxx
│   │   ├── Makefile2
│   │   ├── Makefile.cmake
│   │   ├── progress.marks
│   │   ├── run_tests.dir
│   │   │   ├── build.make
│   │   │   ├── cmake_clean.cmake
│   │   │   ├── DependInfo.cmake
│   │   │   └── progress.make
│   │   ├── TargetDirectories.txt
│   │   └── tests.dir
│   │       ├── build.make
│   │       ├── cmake_clean.cmake
│   │       ├── DependInfo.cmake
│   │       └── progress.make
│   ├── cmake_install.cmake
│   ├── CTestTestfile.cmake
│   ├── gtest
│   │   ├── CMakeFiles
│   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   ├── gtest.dir
│   │   │   │   ├── build.make
│   │   │   │   ├── cmake_clean.cmake
│   │   │   │   ├── DependInfo.cmake
│   │   │   │   ├── depend.make
│   │   │   │   ├── flags.make
│   │   │   │   ├── link.txt
│   │   │   │   ├── progress.make
│   │   │   │   └── src
│   │   │   ├── gtest_main.dir
│   │   │   │   ├── build.make
│   │   │   │   ├── cmake_clean.cmake
│   │   │   │   ├── DependInfo.cmake
│   │   │   │   ├── depend.make
│   │   │   │   ├── flags.make
│   │   │   │   ├── link.txt
│   │   │   │   ├── progress.make
│   │   │   │   └── src
│   │   │   └── progress.marks
│   │   ├── cmake_install.cmake
│   │   ├── CTestTestfile.cmake
│   │   └── Makefile
│   ├── Makefile
│   └── test_results
├── devel
│   ├── env.sh
│   ├── lib
│   ├── setup.bash
│   ├── setup.sh
│   ├── _setup_util.py
│   └── setup.zsh
└── src
    └── CMakeLists.txt -> /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake

28 directories, 87 files
ligang@ligang-Vostro-220-Series:~/catkin_ws$

source devel/setup.bash
echo $ROS_PACKAGE_PATH

sudo apt-get install ros-kinetic-ros-tutorials
rospack find roscpp
 rospack list
roscd roscpp
pwd
roscd log
ligang@ligang-Vostro-220-Series:~/.ros/log$ rosls roscpp_tutorials
cmake  launch  package.xml  srv


Creating a catkin Package


cd ~/catkin_ws/src
ligang@ligang-Vostro-220-Series:~/.ros/log$ cd ~/catkin_ws/src
ligang@ligang-Vostro-220-Series:~/catkin_ws/src$ ls
CmakeLists.txt

ligang@ligang-Vostro-220-Series:~/catkin_ws/src$ tree
.
├── beginner_tutorials
│   ├── CMakeLists.txt
│   ├── include
│   │   └── beginner_tutorials
│   ├── package.xml
│   └── src
└── CMakeLists.txt -> /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake

4 directories, 3 files
ligang@ligang-Vostro-220-Series:~/catkin_ws/src$
cd ~/catkin_ws

32 directories, 89 files
ligang@ligang-Vostro-220-Series:~/catkin_ws$
gedit ~/.bashrc 使用C构建节点: (1),构建工作空间: zhsd_lg_ros

mkdir -p ~/zhsd_lg_ros/src
cd ~/zhsd_lg_ros/src
catkin_init_workspace
cd ~/zhsd_lg_ros/
catkin_make
source devel/setup.bash
echo $ROS_PACKAGE_PATH
catkin_make install
cd src
pwd
ligang@ligang-MS-7817:~/zhsd_lg_ros/src$
catkin_create_pkg zhsd_test01 std_msgs rospy roscpp
cd ..
catkin_make
 . ~/zhsd_lg_ros/devel/setup.bash
rospack depends1 zhsd_test01
roscpp
rospy
std_msgs
roscd zhsd_test01/
cat package.xml
rospack depends zhsd_test01


add this to makefile

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker zhsd_test01_generate_messages_cpp)

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener zhsd_test01_generate_messages_cpp)

====================================================================
talker.cpp
====================================================================

#include "ros/ros.h"
#include "std_msgs/String.h"

#include <sstream>

/**
 * This tutorial demonstrates simple sending of messages over the ROS system.
 */
int main(int argc, char **argv)
{
  /**
   * The ros::init() function needs to see argc and argv so that it can perform
   * any ROS arguments and name remapping that were provided at the command line.
   * For programmatic remappings you can use a different version of init() which takes
   * remappings directly, but for most command-line programs, passing argc and argv is
   * the easiest way to do it.  The third argument to init() is the name of the node.
   *
   * You must call one of the versions of ros::init() before using any other
   * part of the ROS system.
   */
  ros::init(argc, argv, "talker");

  /**
   * NodeHandle is the main access point to communications with the ROS system.
   * The first NodeHandle constructed will fully initialize this node, and the last
   * NodeHandle destructed will close down the node.
   */
  ros::NodeHandle n;

  /**
   * The advertise() function is how you tell ROS that you want to
   * publish on a given topic name. This invokes a call to the ROS
   * master node, which keeps a registry of who is publishing and who
   * is subscribing. After this advertise() call is made, the master
   * node will notify anyone who is trying to subscribe to this topic name,
   * and they will in turn negotiate a peer-to-peer connection with this
   * node.  advertise() returns a Publisher object which allows you to
   * publish messages on that topic through a call to publish().  Once
   * all copies of the returned Publisher object are destroyed, the topic
   * will be automatically unadvertised.
   *
   * The second parameter to advertise() is the size of the message queue
   * used for publishing messages.  If messages are published more quickly
   * than we can send them, the number here specifies how many messages to
   * buffer up before throwing some away.
   */
  ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);

  ros::Rate loop_rate(10);

  /**
   * A count of how many messages we have sent. This is used to create
   * a unique string for each message.
   */
  int count = 0;
  while (ros::ok())
  {
    /**
     * This is a message object. You stuff it with data, and then publish it.
     */
    std_msgs::String msg;

    std::stringstream ss;
    ss << "hello world " << count;
    msg.data = ss.str();

    ROS_INFO("%s", msg.data.c_str());

    /**
     * The publish() function is how you send messages. The parameter
     * is the message object. The type of this object must agree with the type
     * given as a template parameter to the advertise<>() call, as was done
     * in the constructor above.
     */
    chatter_pub.publish(msg);

    ros::spinOnce();

    loop_rate.sleep();
    ++count;
  }


  return 0;
}

=======================================================================
====================================================================
listener.cpp
===========================================================================

#include "ros/ros.h"
#include "std_msgs/String.h"

/**
 * This tutorial demonstrates simple receipt of messages over the ROS system.
 */
void chatterCallback(const std_msgs::String::ConstPtr& msg)
{
  ROS_INFO("I heard: [%s]", msg->data.c_str());
}

int main(int argc, char **argv)
{
  /**
   * The ros::init() function needs to see argc and argv so that it can perform
   * any ROS arguments and name remapping that were provided at the command line.
   * For programmatic remappings you can use a different version of init() which takes
   * remappings directly, but for most command-line programs, passing argc and argv is
   * the easiest way to do it.  The third argument to init() is the name of the node.
   *
   * You must call one of the versions of ros::init() before using any other
   * part of the ROS system.
   */
  ros::init(argc, argv, "listener");

  /**
   * NodeHandle is the main access point to communications with the ROS system.
   * The first NodeHandle constructed will fully initialize this node, and the last
   * NodeHandle destructed will close down the node.
   */
  ros::NodeHandle n;

  /**
   * The subscribe() call is how you tell ROS that you want to receive messages
   * on a given topic.  This invokes a call to the ROS
   * master node, which keeps a registry of who is publishing and who
   * is subscribing.  Messages are passed to a callback function, here
   * called chatterCallback.  subscribe() returns a Subscriber object that you
   * must hold on to until you want to unsubscribe.  When all copies of the Subscriber
   * object go out of scope, this callback will automatically be unsubscribed from
   * this topic.
   *
   * The second parameter to the subscribe() function is the size of the message
   * queue.  If messages are arriving faster than they are being processed, this
   * is the number of messages that will be buffered up before beginning to throw
   * away the oldest ones.
   */
  ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);

  /**
   * ros::spin() will enter a loop, pumping callbacks.  With this version, all
   * callbacks will be called from within this thread (the main one).  ros::spin()
   * will exit when Ctrl-C is pressed, or the node is shutdown by the master.
   */
  ros::spin();

  return 0;
}


====================================================================

cd ~/zhsd_lg_ros/
catkin_make
gedit ~/.bashrc
source ~/zhsd_lg_ros/devel/setup.bash

rosrun zhsd_test01 talker
rosrun zhsd_test01 listener


Now change listener.cpp to listen /odom topic and print the msg

#include "ros/ros.h"
#include "std_msgs/String.h"
#include <nav_msgs/Odometry.h>
#include <tf/transform_broadcaster.h>

/**
 * This tutorial demonstrates simple receipt of messages over the ROS system.
 */
void chatterCallback(const nav_msgs::Odometry::ConstPtr& msg)
{
  ROS_INFO("I heard x: [%f]", msg->pose.pose.position.x);
  ROS_INFO("I heard y: [%f]", msg->pose.pose.position.y);
}

int main(int argc, char **argv)
{
  /**
   * The ros::init() function needs to see argc and argv so that it can perform
   * any ROS arguments and name remapping that were provided at the command line.
   * For programmatic remappings you can use a different version of init() which takes
   * remappings directly, but for most command-line programs, passing argc and argv is
   * the easiest way to do it.  The third argument to init() is the name of the node.
   *
   * You must call one of the versions of ros::init() before using any other
   * part of the ROS system.
   */
  ros::init(argc, argv, "listener");

  /**
   * NodeHandle is the main access point to communications with the ROS system.
   * The first NodeHandle constructed will fully initialize this node, and the last
   * NodeHandle destructed will close down the node.
   */
  ros::NodeHandle n;

  /**
   * The subscribe() call is how you tell ROS that you want to receive messages
   * on a given topic.  This invokes a call to the ROS
   * master node, which keeps a registry of who is publishing and who
   * is subscribing.  Messages are passed to a callback function, here
   * called chatterCallback.  subscribe() returns a Subscriber object that you
   * must hold on to until you want to unsubscribe.  When all copies of the Subscriber
   * object go out of scope, this callback will automatically be unsubscribed from
   * this topic.
   *
   * The second parameter to the subscribe() function is the size of the message
   * queue.  If messages are arriving faster than they are being processed, this
   * is the number of messages that will be buffered up before beginning to throw
   * away the oldest ones.
   */
  ros::Subscriber sub = n.subscribe("odom", 1000, chatterCallback);

  /**
   * ros::spin() will enter a loop, pumping callbacks.  With this version, all
   * callbacks will be called from within this thread (the main one).  ros::spin()
   * will exit when Ctrl-C is pressed, or the node is shutdown by the master.
   */
  ros::spin();

  return 0;
}


nav guide and others
================================================================== 增加时间同步: 选择一台服务器,IP10.168.10.10
sudo apt-get install chrony
sudo vi /etc/chrony/chrony.conf
server 0.debian.pool.ntp.org offline minpoll 8
server 1.debian.pool.ntp.org offline minpoll 8
server 2.debian.pool.ntp.org offline minpoll 8
server 3.debian.pool.ntp.org offline minpoll 8
->
server 1.cn.pool.ntp.org
server 1.asia.pool.ntp.org
server 0.asia.pool.ntp.org 下面的IP为允许访问的IP
allow 10/8
allow 192.168/16
allow 172.16/12 重启chrony服务即可 sudo service chrony restart 其他节点: 使用chrony工具 只需要将“server”项修改为上面的时间服务器即可 server 10.168.10.10 或: 使用ntpd
yum install ntp 修改配置文件,添加“server 10.168.10.10” 到下面的配置文件vi /etc/ntp.conf
================================================================== 刻录ubuntu系统: remastersys
sudo remastersys
sudo remastersys disk cdfs
sudo remasteryss dist iso filename.iso
/home/remastersys
================================================================== 安装rbx1包: cd ~/catkin_ws/src
git clone https://github.com/pirobot/rbx1.git
cd rbx1
git checkout hydro-devel
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
================================================================== 增加USB串口权限更改: /dev/ttyUSB0 增加权限 创建文件/etc/udev/rules.d/70-ttyusb.rules 在文件内增加一行 KERNEL=="ttyUSB[0-9]*", MODE="0666" 重新插入USB转串口设备,普通用户就有权限访问了。 ================================================================== 设置环境变量: gedit ~/.bashrc
add source ~/catkin_ws/devel/setup.bash
================================================================== 简单的收发测试: cd ~/catkin_ws
catkin_make
roscore
rosrun beginner_tutorials talker
rosrun beginner_tutorials listener
================================================================== 模拟导航测试: roscore
roslaunch rbx1_bringup fake_turtlebot.launch
roslaunch rbx1_nav fake_move_base_blank_map.launch
rosrun rviz rviz -d /home/ligang/catkin_ws/src/rbx1/rbx1_nav/nav.rviz
rosrun rviz rviz -d 'rospack find rbx1_nav'/nav.rviz

for test edit for ture robot

roscore
roslaunch rbx1_bringup lgtest0.launch
roslaunch rbx1_nav lgtest1.launch
rosrun rviz rviz -d /home/ligang/catkin_ws/src/rbx1/rbx1_nav/nav.rviz 修改说明: /home/ligang/catkin_ws/src/rbx1/rbx1_bringup/launch/lgtest0.launch 增加重定位: <remap from="/cmd_vel" to="/cmd_velaa" />
<remap from="/odom" to="/odomaaa" />  //ok

/home/ligang/catkin_ws/src/rbx1/rbx1_nav/launch/lgtest2.launch
<remap from="/odom" to="/odomaaa" />
<remap from="/cmd_vel" to="/cmd_velaa" />

topic 列表: /cmd_vel
/diagnostics
/initialpose
/joint_states
/map
/map_metadata
/map_updates
/move_base/NavfnROS/plan
/move_base/TrajectoryPlannerROS/cost_cloud
/move_base/TrajectoryPlannerROS/global_plan
/move_base/TrajectoryPlannerROS/local_plan
/move_base/TrajectoryPlannerROS/parameter_descriptions
/move_base/TrajectoryPlannerROS/parameter_updates
/move_base/cancel
/move_base/current_goal
/move_base/feedback
/move_base/global_costmap/costmap
/move_base/global_costmap/costmap_updates
/move_base/global_costmap/footprint
/move_base/global_costmap/inflation_layer/parameter_descriptions
/move_base/global_costmap/inflation_layer/parameter_updates
/move_base/global_costmap/obstacle_layer/parameter_descriptions
/move_base/global_costmap/obstacle_layer/parameter_updates
/move_base/global_costmap/obstacle_layer_footprint/footprint_stamped
/move_base/global_costmap/obstacle_layer_footprint/parameter_descriptions
/move_base/global_costmap/obstacle_layer_footprint/parameter_updates
/move_base/global_costmap/parameter_descriptions
/move_base/global_costmap/parameter_updates
/move_base/global_costmap/static_layer/parameter_descriptions
/move_base/global_costmap/static_layer/parameter_updates
/move_base/goal
/move_base/local_costmap/costmap
/move_base/local_costmap/costmap_updates
/move_base/local_costmap/footprint
/move_base/local_costmap/inflation_layer/parameter_descriptions
/move_base/local_costmap/inflation_layer/parameter_updates
/move_base/local_costmap/obstacle_layer/parameter_descriptions
/move_base/local_costmap/obstacle_layer/parameter_updates
/move_base/local_costmap/obstacle_layer_footprint/footprint_stamped
/move_base/local_costmap/obstacle_layer_footprint/parameter_descriptions
/move_base/local_costmap/obstacle_layer_footprint/parameter_updates
/move_base/local_costmap/parameter_descriptions
/move_base/local_costmap/parameter_updates
/move_base/local_costmap/static_layer/parameter_descriptions
/move_base/local_costmap/static_layer/parameter_updates
/move_base/parameter_descriptions
/move_base/parameter_updates
/move_base/result
/move_base/status
/move_base_simple/goal
/odom
/rosout
/rosout_agg
/scan
/tf
/tf_static
/waypoint_markers
/waypoint_markers_array 根据rqt_graphtopic发布者,进行重定位topic名称,实现ros节点通讯的链接 非全路径: roscore
roslaunch rbx1_bringup fake_turtlebot.launch
roslaunch rbx1_nav fake_move_base_blank_map.launch
rosrun rviz rviz -d 'rospack find rbx1_nav'/nav.rviz
==================================================================

rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped \ '{ header: { frame_id: "map" }, pose: { position: { x: 1.0, y: 1.4, z: 0 } ,orientation: { x: 0, y: 0, z: 0, w: 1}}}'


rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped \ '{ header: { frame_id: "map" }, pose: { position: { x: 0.0, y: 0.4, z: 0 } ,orientation: { x: 0, y: 0, z: 0, w: 1}}}'


wget http://pr.willowgarage.com/data/gmapping/basic_localization_stage.bag
rosbag play --clock basic_localization_stage.bag
================================================================== 扫描数据,制造地图 在单个计算机上运行: https://github.com/DaikiMaekawa/hector_slam_example 安装另一个包 https://github.com/tu-darmstadt-ros-pkg/hector_slam
1,roscore
2,roslaunch hector_slam_example hector_rplidar.launch
3,roslaunch rplidar_ros rplidar.launch

http://roscon.ros.org/2016/
================================================================== 双机构建ROS系统: 在两个个计算机上运行 笔记本: ubuntu 笔记本名字,通过hostname命令查询 Zeroconf主机名:ubuntu.local
192.168.20.215 台式机: ligang-MS-7817 台式机名字,通过hostname命令查询 Zeroconf主机名:ligang-MS-7817.local
192.168.20.163 在两台计算机上安装chrony 用于时间同步 sudo apt-get install chrony
ubuntu系统自带Zeroconf功能 使用ping测试连通性: 台式机上运行:测试与笔记本的连通性 ping ubuntu.local 笔记本上运行:测试与台式机的连通性 ping ligang-MS-7817.local 笔记本作为机器人使用: export ROS_HOSTNAME=ubuntu.local
roscore 台式机上运行: export ROS_HOSTNAME=ligang-MS-7817.local
export ROS_MASTER_URI=http://ubuntu.local:11311 设置环境变量: gedit ~/.bashrc
add export ROS_MASTER_URI=http://ubuntu.local:11311 检查时间同步: sudo ntpdate -b ubuntu.local 查询topic
rostopic list
================================================================== 双机上运行: 笔记本,启动激光雷达: roslaunch rplidar_ros rplidar.launch 台式机,启动gmapping
roslaunch hector_slam_example hector_rplidar.launch
==================================================================
*****

gmapping步骤: 雷达厂商提供的slam代码: https://github.com/robopeak/rplidar_ros/tree/slam 增加下述代码进行地图的保存: roslaunch rplidar_ros view_slam.launch
rosrun map_server map_saver -f aaamap 查询图像: eog abc.map.pgm 如果是从源安装,需要编译: rosmake gmapping 生成一个bag
Bring up启动机器人(带激光雷达扫描,并发布数据),使用joystick手柄遥控 记录雷达数据: rosbag record -O mylaserdata /base_scan /tf 或者下载一个bag数据包 wget http://pr.willowgarage.com/data/gmapping/basic_localization_stage.bag 启动ROS
roscore 使用sim时间 rosparam set use_sim_time true 启动slam_gmapping, 带激光扫描,生成地图 rosrun gmapping slam_gmapping scan:=base_scan

PR2
rosrun gmapping slam_gmapping scan:=base_scan _odom_frame:=odom_combined 在新的终端中回放bag数据 rosbag play --clock <name of the bag that you downloaded / created in step 2> 保存生成的图像 rosrun map_server map_saver -f aaamap 察看图像 eog aaamap.pgm 观察生成的图像 rosrun rviz rviz
Add a display with a map, set to the topic /map
==================================================================
rbx2的学习: roslaunch rbx2_description box_robot_base_only.launch
roslaunch zhsdbot_description box_robot_base_only.launch
roslaunch rbx2_description pi_robot_base_with_laser.launch
roslaunch rbx2_bringup fake_box_robot_with_gripper.launch
rosrun rviz rviz -d 'rospack find rbx2_description'/urdf.rviz
rosrun rviz rviz -d 'rospack find zhsdbot_description'/urdf.rviz
rosrun rviz rviz -d 'rospack find rbx2_bringup'/sim.rviz
arbotix_gui
catkin_create_pkg zhsdbot_description roscpp rospy urdf
================================================================== 安装rbx1
cd ~/catkin_ws/src
git clone https://github.com/pirobot/rbx1.git
cd rbx1
git checkout hydro-devel
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash

==================================================================
rbx2预先安装 rbx2-prereq.sh
#!/binsh

# Install the prerequisites for the ROS By Example code, Volume 2

sudo apt-get install ros-hydro-arbotix \
ros-hydro-dynamixel-motor ros-hydro-rosbridge-suite \
ros-hydro-mjpeg-server ros-hydro-rgbd-launch \
ros-hydro-openni-camera ros-hydro-moveit-full \
ros-hydro-turtlebot-* ros-hydro-kobuki-* ros-hydro-moveit-python \
python-pygraph python-pygraphviz python-easygui \
mini-httpd ros-hydro-laser-pipeline ros-hydro-ar-track-alvar \
ros-hydro-laser-filters ros-hydro-hokuyo-node \
ros-hydro-depthimage-to-laserscan ros-hydro-moveit-ikfast \
ros-hydro-gazebo-ros ros-hydro-gazebo-ros-pkgs \
ros-hydro-gazebo-msgs ros-hydro-gazebo-plugins \
ros-hydro-gazebo-ros-control ros-hydro-cmake-modules \
ros-hydro-kobuki-gazebo-plugins ros-hydro-kobuki-gazebo \
ros-hydro-smach ros-hydro-smach-ros ros-hydro-grasping-msgs \
ros-hydro-executive-smach ros-hydro-smach-viewer \
ros-hydro-robot-pose-publisher ros-hydro-tf2-web-republisher \
ros-hydro-move-base-msgs ros-hydro-fake-localization \
graphviz-dev libgraphviz-dev gv python-scipy sdformat

==================================================================

<remap from="/a" to="/prefix/a" />
分享:
游客
要评论请先登录 或者 注册
返回顶部