Noetic差速机器人MPC控制

源码下载

第一个是mpc-ros的代码,第二个是机器人模型包

git clone https://github.com/Geonhee-LEE/mpc_ros.git 
git clone https://github.com/CzJaewan/servingbot.git

在一个工作空间下编译,本人是Noetic版本,要做修改

修改mpc_ros/launch下的ref_trajectory_tracking_gazebo.launch

<!--  ************** Robot model ***************  -->
    <param name="robot_description" command="$(find xacro)/xacro $(find servingbot_description)/urdf/servingbot.urdf.xacro.py" if="$(eval model == 'serving_bot')"/>

去掉.py

<!--  ************** Robot model ***************  -->
    <param name="robot_description" command="$(find xacro)/xacro $(find servingbot_description)/urdf/servingbot.urdf.xacro" if="$(eval model == 'serving_bot')"/>

修改mpc_ros/script下的mpc_trajectory_generation.py。注释掉两个global trajectory_type,两处位置如下

def generation_desired_path():
    '''
    Create desired path
    '''
    #global trajectory_type
    rospy.loginfo("generation_desired_path()")
    
    desired_path = Path()
    iter = 1000
    
    if trajectory_type == "circle":
if __name__ == '__main__':
    rospy.init_node('path_node')
    rospy.loginfo("path_node is started!!")
    #global trajectory_type
    trajectory_type =  rospy.get_param('~trajectory_type')
    odom_sub = rospy.Subscriber('/odom', Odometry, odom_cb)

修改后运行

roslaunch mpc_ros ref_trajectory_tracking_gazebo.launch

在这里插入图片描述

  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值