电商网站目录优化,个人博客自我介绍,广告联盟排行榜,海外网站加速器这一部分目的是将真实的机器人映射到gazebo中#xff0c;使得gazebo中的其他虚拟机器人能识别到真实世界的wheeltec机器人。
真实机器人的型号的wheeltec旗下的mini_mec。
一、在wheeltec官方百度云文档中找到URDF原始导出功能包.zip
找到对应的包 拷贝到工作空间下
在原有…这一部分目的是将真实的机器人映射到gazebo中使得gazebo中的其他虚拟机器人能识别到真实世界的wheeltec机器人。
真实机器人的型号的wheeltec旗下的mini_mec。
一、在wheeltec官方百度云文档中找到URDF原始导出功能包.zip
找到对应的包 拷贝到工作空间下
在原有文件基础上新建如下文件 mini_mec_robot_run.urdf.xacro文件内容
?xml version1.0?
robot namemini_mec_robot xmlns:xacrohttp://www.ros.org/wiki/xacroxacro:property nameprefix value$(arg prefix) /xacro:if value${prefix / or prefix or prefix }xacro:property nametf_prefix value //xacro:ifxacro:unless value${prefix / or prefix or prefix }xacro:property nametf_prefix value${prefix}/ //xacro:unlessxacro:include filename$(find mini_mec_robot)/urdf/mini_mec_robot.urdf.xacro /xacro:include filename$(find mini_mec_robot)/urdf/lidar_gazebo.xacro /mini_mec_robot//robotmini_mec_robot.urdf.xacro
这个文件是基于mini_mec_robot.urdf制作的主要是copy mini_mec_robot.urdf文件中的关节和link关系再配置gazebo中关键link的颜色材质以及odom的计算并发布odom到baselink之间的tf变换。
?xml version1.0 encodingutf-8?
robot xmlns:xacrohttp://www.ros.org/wiki/xacro这里插入urdf中robot内部的内容link和joint前面都加上${tf_prefix}gazebo reference${tf_prefix}base_linkmaterialGazebo/Grey/material/gazebogazebo reference${tf_prefix}lb_wheel_link mu10.1/mu1mu20.1/mu2kp500000.0/kpkd10.0/kdmaterialGazebo/DarkGrey/materialmaxVel0.1/maxVelminDepth0.001/minDepthfdir11 0 0/fdir1/gazebogazebo reference${tf_prefix}lf_wheel_linkmu10.1/mu1mu20.1/mu2kp500000.0/kpkd10.0/kdmaterialGazebo/DarkGrey /materialmaxVel0.1/maxVelminDepth0.001/minDepthfdir11 0 0/fdir1/gazebogazebo reference${tf_prefix}rf_wheel_linkmu10.1/mu1mu20.1/mu2kp500000.0/kpkd10.0/kdmaterialGazebo/DarkGrey /materialmaxVel0.1/maxVelminDepth0.001/minDepthfdir11 0 0/fdir1/gazebogazebo reference${tf_prefix}rb_wheel_linkmu10.1/mu1mu20.1/mu2kp500000.0/kpkd10.0/kdmaterialGazebo/DarkGrey /materialmaxVel0.1/maxVelminDepth0.001/minDepthfdir11 0 0/fdir1/gazebo!-- gazebo reference${tf_prefix}caster_wheel_link materialGazebo/DarkGrey /materialmaxVel0.0/maxVelminDepth0.001/minDepth/gazebo --!-- controller 这是2轮为odom到bselink的tf--!-- gazeboplugin namedifferential_drive_controller filenamelibgazebo_ros_diff_drive.sorosDebugLevelError/rosDebugLevelpublishWheelTFfalse/publishWheelTFrobotNamespace//robotNamespacepublishTftrue/publishTfpublishOdomTFtrue/publishOdomTFpublishWheelJointStatefalse/publishWheelJointStateupdateRate50/updateRatelegacyModefalse/legacyMode --!-- 前轮 --!-- leftJoint${tf_prefix}lf_wheel_joint/leftJointrightJoint${tf_prefix}rf_wheel_joint/rightJoint --!-- 轮子的相关参数 --!-- wheelSeparation0.1/wheelSeparationwheelDiameter0.043/wheelDiameterbroadcastTF1/broadcastTFwheelTorque20/wheelTorquewheelAcceleration1.0/wheelAcceleration --!-- 控制命令与里程计话题 --!-- commandTopic${tf_prefix}cmd_vel/commandTopicodometryFrame${tf_prefix}odom/odometryFrameodometryTopic${tf_prefix}odom/odometryTopicodometrySourceworld/odometrySourcerobotBaseFrame${tf_prefix}base_link/robotBaseFrame/plugin
这是4全向轮计算odom并发布odom和baselinkTF的
/gazebo --gazeboplugin namemecanum_controller filenamelibgazebo_ros_planar_move.so
!-- 这两个似乎会自带${tf_prefix} --commandTopiccmd_vel/commandTopicodometryTopicodom/odometryTopicodometryFrame${tf_prefix}odom/odometryFrameleftFrontJointlf_wheel_joint/leftFrontJointrightFrontJointrf_wheel_joint/rightFrontJointleftRearJointlb_wheel_joint/leftRearJointrightRearJointrb_wheel_joint/rightRearJointodometryRate20.0/odometryRateodometrySourceworld/odometrySourcerobotBaseFrame${tf_prefix}base_link/robotBaseFrame/plugin
/gazebo/robot
lidar_gazebo.xacro这是虚拟雷达文件
?xml version1.0?
robot xmlns:xacrohttp://www.ros.org/wiki/xacro namelidar!-- Create laser reference frame --gazebo reference${tf_prefix}laser sensor typeray namerplidarpose0 0 0 0 0 0/posevisualizefalse/visualizeupdate_rate5.5/update_raterayscanhorizontalsamples360/samplesresolution1/resolutionmin_angle-3/min_anglemax_angle3/max_angle/horizontal/scanrangemin0.10/minmax6.0/maxresolution0.01/resolution/rangenoisetypegaussian/typemean0.0/meanstddev0.01/stddev/noise/rayplugin namegazebo_rplidar filenamelibgazebo_ros_laser.sorobotNamespace//robotNamespacetopicName${tf_prefix}scan/topicNameframeName${tf_prefix}laser/frameName/plugin/sensor/gazebo/robot新建一个功能包wheeltec 新建launch/includes/model_wheeltec.launch.xml
launch!-- 迷你机器人基础参数 --arg namerobot_name /arg namemodel /arg namegui defaultFalse /!-- 加载机器人模型描述参数 --param namerobot_description command$(find xacro)/xacro --inorder $(find mini_mec_robot)/urdf/mini_mec_robot_run.urdf.xacro prefix:$(arg robot_name) /!-- 运行joint_state_publisher节点发布机器人的关节状态 --node namejoint_state_publisher pkgjoint_state_publisher typejoint_state_publisher param namerate value50//node !-- 运行robot_state_publisher节点发布tf --node namerobot_state_publisher pkgrobot_state_publisher typerobot_state_publisher outputscreen param namepublish_frequency typedouble value50.0 //node
/launch在我的wxfpublish功能包的launch文件夹新建 spawn_wheeltec.launch
launch!-- 迷你机器人基础参数 --arg namerobot_name defaultwheeltec_01 /!-- 仿真环境机器人初始位置 --arg nameinitial_pose_x default-1.0/arg nameinitial_pose_y default0.0/!-- arg nameinitial_pose_Y default0.0581694505/ --!-- 偏航角wxf手动调教的参数还有一些误差在 --arg nameinitial_pose_Y default0/!-- 偏航角wxf手动调教的参数还有一些误差在 --arg nameinit_pose value-x $(arg initial_pose_x) -y $(arg initial_pose_y) -Y $(arg initial_pose_Y) /!-- 迷你机器人模型 --include ns$(arg robot_name) file$(find wheeltec)/launch/includes/model_wheeltec.launch.xmlarg namerobot_name value$(arg robot_name) //include!-- 在gazebo中加载机器人模型--node ns$(arg robot_name) nameurdf_spawner pkggazebo_ros typespawn_model respawnfalse outputscreenargs$(arg init_pose) -urdf -model $(arg robot_name) -param robot_description//launch之后就能正常调用了。