资源简介
ROS通过RPLIDAR-A2实现Gmapping,其中包括机器人描述文件、模型文件、导航文件、运动控制文件等,可有效帮助ROS-SLAM初学者进行基本学习
代码片段和文件信息
#include
#include
#include
#include
int main(int argc char** argv) {
ros::init(argc argv “state_publisher“);
ros::NodeHandle n;
ros::Publisher joint_pub = n.advertise(“joint_states“ 1);
tf::TransformBroadcaster broadcaster;
ros::Rate loop_rate(30);
const double degree = M_PI/180;
// robot state
double inc= 0.005 base_arm_inc= 0.005 arm1_armbase_inc= 0.005 arm2_arm1_inc= 0.005 gripper_inc= 0.005 tip_inc= 0.005;
double angle= 0 base_arm = 0 arm1_armbase = 0 arm2_arm1 = 0 gripper = 0 tip = 0;
// message declarations
geometry_msgs::TransformStamped odom_trans;
sensor_msgs::JointState joint_state;
odom_trans.header.frame_id = “odom“;
odom_trans.child_frame_id = “base_link“;
while (ros::ok()) {
//update joint_state
joint_state.header.stamp = ros::Time::now();
joint_state.name.resize(11);
joint_state.position.resize(11);
joint_state.name[0] =“base_to_arm_base“;
joint_state.position[0] = base_arm;
joint_state.name[1] =“arm_1_to_arm_base“;
joint_state.position[1] = arm1_armbase;
joint_state.name[2] =“arm_2_to_arm_1“;
joint_state.position[2] = arm2_arm1;
joint_state.name[3] =“left_gripper_joint“;
joint_state.position[3] = gripper;
joint_state.name[4] =“left_tip_joint“;
joint_state.position[4] = tip;
joint_state.name[5] =“right_gripper_joint“;
joint_state.position[5] = gripper;
joint_state.name[6] =“right_tip_joint“;
joint_state.position[6] = tip;
joint_state.name[7] =“base_to_wheel1“;
joint_state.position[7] = 0;
joint_state.name[8] =“base_to_wheel2“;
joint_state.position[8] = 0;
joint_state.name[9] =“base_to_wheel3“;
joint_state.position[9] = 0;
joint_state.name[10] =“base_to_wheel4“;
joint_state.position[10] = 0;
// update transform
// (moving in a circle with radius)
odom_trans.header.stamp = ros::Time::now();
odom_trans.transform.translation.x = cos(angle);
odom_trans.transform.translation.y = sin(angle);
odom_trans.transform.translation.z = 0.0;
odom_trans.transform.rotation = tf::createQuaternionMsgFromYaw(angle);
//send the joint state and transform
joint_pub.publish(joint_state);
broadcaster.sendTransform(odom_trans);
// Create new robot state
arm2_arm1 += arm2_arm1_inc;
if (arm2_arm1<-1.5 || arm2_arm1>1.5) arm2_arm1_inc *= -1;
arm1_armbase += arm1_armbase_inc;
if (arm1_armbase>1.2 || arm1_armbase<-1.0) arm1_armbase_inc *= -1;
base_arm += base_arm_inc;
if (base_arm>1. || base_arm<-1.0) base_arm_inc *= -1;
gripper += gripper_inc;
if (gripper<0 || gripper>1) gripper_inc *= -1;
angle += degree/4;
// This will adjust as needed per iteration
loop_rate.sleep
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\
文件 42 2018-05-10 13:06 ROS-SLAM-Gmapping-master\README.md
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\
文件 9279 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\ROSArduinoBridge.ino
文件 542 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\commands.h
文件 3994 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\diff_controller.h
文件 630 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\encoder_driver.h
文件 2340 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\encoder_driver.ino
文件 302 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\motor_driver.h
文件 1696 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\motor_driver.ino
文件 1001 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\sensors.h
文件 997 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\servos.h
文件 1791 2018-05-10 13:06 ROS-SLAM-Gmapping-master\ROSArduinoBridge\servos.ino
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 5442 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 1190 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 781 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 536 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 535 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 508 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 508 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 40678 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 87855 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 2795 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 3028 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 4735 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
目录 0 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
文件 268 2018-05-10 13:06 ROS-SLAM-Gmapping-master\robot1_desc
............此处省略225个文件信息
- 上一篇:电影座选座功能有情侣坐
- 下一篇:计算机系统基础 参考题
相关资源
- MicroSD 中文规格书
- 轮式移动机器人FastSLAM算法研
- UML网上租房系统
- ROS3.30视频教程56+教案
- MicroSoftProject
- 汇编编译器 masm (Microsoft Macro Assemb
- Energy-Efficient Communication Protocol for Wi
- 网上书店 用例图 活动图 类图 UML
- RouterOS软路由中文编码转换,RouterOS使
- rose画图软件
- ros的urdf机器人模型
- RoseCommon破解文件
- Rosenfeld细化算法,针对汉字二值图像
- The GraphSLAM algorithm
- 风玫瑰图制做程序windRose V1.0.1
- 风玫瑰图制做程序 windrose
- rational_perm.dat
- MicrosoftFixit50450.msi
- LAS 1.4格式定义
- RevendeproSrc
- ROSE双机注册码
- 机器人操作系统ROS-典型功能代码详解
- ROS 扫地机器人路径覆盖及控制源码
- Microsoft Office 2007 加载项:Microsoft Sa
- Suppressing Phosphatidylcholine-specific Phosp
- Multifractal detrended cross-correlation analy
- 论文研究 - 整体放射剂量的剂量学比
- 三维激光扫描仪点云数据在MicroSatio
- “Microsoft Office Word已停止工作&rd
- 时滞Cohen-Grossberg神经网络p阶矩ψ(
评论
共有 条评论