《ROS机器人高效编程》书的代码


这本书环境是ROS-Kinect,具体安装配置请看ROS wiki。
资源截图
代码片段和文件信息
#include 
#include 
#include 
#include 

main (int argc char **argv)
{
    ros::init (argc argv “pcl_create“);

    ros::NodeHandle nh;
    ros::Publisher pcl_pub = nh.advertise (“pcl_output“ 1);
    pcl::PointCloud cloud;
    sensor_msgs::PointCloud2 output;

    // Fill in the cloud data
    cloud.width  = 100;
    cloud.height = 1;
    cloud.points.resize(cloud.width * cloud.height);

    for (size_t i = 0; i < cloud.points.size (); ++i)
    {
        cloud.points[i].x = 1024 * rand () / (RAND_MAX + 1.0f);
        cloud.points[i].y = 1024 * rand () / (RAND_MAX + 1.0f);
        cloud.points[i].z = 1024 * rand () / (RAND_MAX + 1.0f);
    }

    //Convert the cloud to ROS message
    pcl::toROSMsg(cloud output);
    output.header.frame_id = “odom“;

    ros::Rate loop_rate(1);
    while (ros::ok())
    {
        pcl_pub.publish(output);
        ros::spinOnce();
        loop_rate.sleep();
    }

    return 0;
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-master
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorials
     文件        1572  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialsCMakeLists.txt
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialsdata
     文件    17492958  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialsdata est_pcd.pcd
     文件        3608  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialsdatawrite_pcd_test.pcd
     文件        1116  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialspackage.xml
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrc
     文件        1063  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_create.cpp
     文件        1178  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_downsampling.cpp
     文件        1207  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_filter.cpp
     文件        1569  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_matching.cpp
     文件        1811  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_model_estimation.cpp
     文件        1720  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_partitioning.cpp
     文件        2524  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_planar_segmentation.cpp
     文件         711  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_read.cpp
     文件        1043  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_visualize.cpp
     文件        2005  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_visualize2.cpp
     文件         559  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter10_tutorialssrcpcl_write.cpp
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorials
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialscfg
     文件         843  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialscfgchapter2.cfg
     文件        6628  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialsCMakeLists.txt
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialslaunch
     文件         208  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialslaunchchapter2.launch
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialsmsg
     文件          24  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialsmsgchapter2_msg1.msg
     文件        1033  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialspackage.xml
     目录           0  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialssrc
     文件         527  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialssrcexample1_a.cpp
     文件         358  2017-11-23 15:29  effective_robotics_programming_with_ros-mastereffective_robotics_programming_with_ros-masterchapter2_tutorialssrcexample1_b.cpp
............此处省略403个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)