小车型号:scout-v2.0

https://github.com/agilexrobotics/scout_ros(所用包的下载地址)

或者

https://hub.fastgit.org/agilexrobotics/scout_ros

注意:使用https://github.com下载的很慢,可以采用国内镜像替换https://www.jianshu.com/p/29824058380f

https://hub.fastgit.org/agilexrobotics/scout_ros

Communication interface setup

不用管前面得序号,直接一步一步敲命令

Setup UART

Generally your RS232-to-USB cable should be automatically recognized as "/dev/ttyUSB0" or something similar and ready for use. If you get the error "... permission denied ..." when trying to open the port, you need to grant access of the port to your user account:

$ sudo usermod -a -G dialout $USER

You need to re-login to get the change to take effect.

Setup CAN-To-USB adapter

  1. Enable gs_usb kernel module

    $ sudo modprobe gs_usb
    
  2. Bringup can device

    $ sudo ip link set can0 up type can bitrate 500000
    
  3. If no error occured during the previous steps, you should be able to see the can device now by using command

    $ ifconfig -a
    
  4. Install and use can-utils to test the hardware

    $ sudo apt install can-utils
    
  5. Testing command

    # receiving data from can0
    $ candump can0
    # send data to can0
    $ cansend can0 001#1122334455667788
  1. Install dependent libraries

  2. $ sudo apt install -y libasio-dev
    $ sudo apt install -y ros-$ROS_DISTRO-teleop-twist-keyboard
    
  3. Clone the packages into your catkin workspace and compile

    (the following instructions assume your catkin workspace is at: ~/catkin_ws/src)

    $ cd ~/catkin_ws/src
    $ git clone --recursive https://github.com/agilexrobotics/ugv_sdk.git
    $ git clone https://github.com/agilexrobotics/scout_ros.git
    $ cd ..
    $ catkin_make
    

    if your car is 1.0 version,Please run this command to switch ugv_sdk to 1.0 version

    $ cd ugv_sdk && git checkout master
    

    then recompile

  4. Launch ROS nodes

  • Start the base node for scout

    $ roslaunch scout_bringup scout_minimal.launch
    

    The scout_bringup/scout_minimal.launch has 5 parameters:

    • port_name: specifies the port used to communicate with the robot, default = "can0"
    • simulated_robot: indicates if launching with a simulation, default = "false"
    • model_xacro: specifies the target ".xacro" file for the publishing of tf frames, default = scout_v2.xacro
    • odom_topic_name: sets the name of the topic which calculated odometry is published to, defaults = "odom"
    • is_scout_mini:Suitable for chassis of type scout_mini,defaults = "false"
  • Start the base node for scout-mini

    $ roslaunch scout_bringup scout_mini_minimal.launch
    
  • Start the keyboard tele-op node

    $ roslaunch scout_bringup scout_teleop_keyboard.launch

一.catkin_make编译时,总失败,报错如下:

param_demo.cpp:(.text+0x50):对‘ros::init(int&, char**, std::string const&, unsigned int)’未定义的引用

param_demo.cpp:(.text+0x80):对‘ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)’未定义的引用

param_demo.cpp:(.text+0xb8):对‘ros::param::get(std::string const&, int&)’未定义的引用

param_demo.cpp:(.text+0x100):对‘ros::NodeHandle::getParam(std::string const&, int&) const’未定义的引用

param_demo.cpp:(.text+0x1e8):对‘ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)’未定义的引用

解决办法:g++ 和gcc 版本不同造成编译错误,参考https://blog.csdn.net/xrinosvip/article/details/81177873

修改成统一版本即可编译成功!!!

命令如下:(查看版本)

gcc -v 

g++ -v

(修改g++ 和gcc的版本,选择数字后回车即可,gcc 和g++ 必须统一才行!)

sudo update-alternatives --config g++

 sudo update-alternatives --config gcc

二.运行roslaunch scout_bringup scout_minimal.launch 报错如下:

RLException: [scout_minimal.launch] is neither a launch file in package [scout_bringup] nor is [scout_bringup] a launch file name
The traceback for the exception was written to the log file
解决方案:在catkin_ws目录下:source ./devel/setup.bash 即可解决

三. nanjingtech@nanjingtech-desktop:~/catkin_ws2$ source ./devel/setup.bash
   nanjingtech@nanjingtech-desktop:~/catkin_ws2$ roslaunch scout_bringup scout_teleop_keyboard.launch 

报错如下:

ModuleNotFoundError: No module named 'rospkg'
[teleop_keybord-1] process has died [pid 7638, exit code 1, cmd /opt/ros/melodic/lib/teleop_twist_keyboard/teleop_twist_keyboard.py __name:=teleop_keybord __log:=/home/nanjingtech/.ros/log/c9cfb1de-edf0-11eb-818c-845cf327b690/teleop_keybord-1.log].
log file: /home/nanjingtech/.ros/log/c9cfb1de-edf0-11eb-818c-845cf327b690/teleop_keybord-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
解决方案参考https://blog.csdn.net/weixin_45688316/article/details/103697198

python版本的问题!! 

解决方案
因为ubuntu18.04使用的ros版本是melodic,而melodic默认使用的是python2,但是我们跑代码实际用的是python3。
所以现在bashrc文件里加

alias python=python3

保存后

source ~/.bashrc

下载rospkg

pip3 install rospkg

问题解决

操作ROS松灵机器人步骤及遇到的问题相关推荐

  1. 松灵机器人二次开发之一

    松灵机器人二次开发--第一天 缘由: 最近学院有一个机器人二次开发的项目.我和朋友被导师推荐了过去,结果去了一头雾水:松灵机器人,linux,导航探测~~对于两个纯软件方面的菜鸟来说毫无头绪.但是没办 ...

  2. 松灵机器人二次开发总结

    松灵机器人二次开发最终总结 前言: 因为最近写完了系统的专利,因此想在这里给故事划上一个句号.前面说到自动检测和报表形成是比较难的操作,其中一个是本系统的核心操作功能,一个是系统的难实现功能.都是本系 ...

  3. SCOUT MINI Pro松灵机器人j建图定点步骤

    一.slam建图实践: (1)启动激光雷达,发布base_link-><laser_link>的坐标变换 source devel/setup.bash roslaunch scou ...

  4. 【ROS】中级操作学习整理-gazebo机器人仿真

    系列文章目录 ·[ROS]中级操作学习整理-gazebo机器人仿真 ·[ROS]中级操作学习整理-TF坐标变换 ·[ROS]中级操作学习整理-传感器建模 ·[ROS]中级操作学习整理-激光SLAM 目 ...

  5. 松灵学院 | Scout mini 仿真指南

    本文适合有 ROS1 基础与了解 urdf语法 和 gazebo 的朋友 SCOUT MINI 是一款全地形高速Mini UGV,具有四轮差速驱动.独立悬挂.原地差速自转等特点,得益于自主研发的轻量级 ...

  6. 【工程记录】基于松灵Scout mini底盘实现小车自主探索建图

    一.硬件配置 松灵scout mini底盘 速腾robense 16线激光雷达 瑞芬imu 因特尔nuc 二.工程技术栈 IMU驱动包(原创) 松灵底盘包(改写,里程计融合IMU角度信息) ROS N ...

  7. ROS学习心得——机器人篇——同一局域网下机器人与主机的通信

    ROS学习心得--机器人篇--同一局域网下机器人与主机的通信 FOR THE SIGMA FOR THE GTINDER FOR THE ROBOMASTER 简介: 关于这一章我将详细的介绍如何利用 ...

  8. ros系统操纵机器人_机器人操纵的关键点表示

    ros系统操纵机器人 Bonus: Also contains details on how to generate labels and learn semantic instance segmen ...

  9. (二)ROS中控制机器人运动(示例运行)

    ROS中让机器人运动的步骤如下: (1)新建机器人模型 (2)运行.launch文件加载模型 (3)加载rviz的配置文件 (4)发布消息使用机器人运动 首先使用<ROS_by_example& ...

最新文章

  1. shell命令卸载mysql_centos8中的MySQL卸载和安装
  2. linux03:系统常用的命令
  3. Android java.lang.UnsatisfiedLinkError
  4. VTK:图片之ImageDifference
  5. 另辟蹊径第二弹,时间规律里的秘密
  6. 【Python】Python3.7.3 - Python内置函数
  7. 【网络安全工程师面试合集】— 渗透资源 操作系统大合集
  8. ros标准版Action通讯
  9. mysql8.0密码重置
  10. 安全浏览器版本过低?该升级浏览器内核了
  11. SpringCloud微服务后台管理系统
  12. 微信小程序 弹出确定取消框
  13. mysql 字段有分隔符_在MySQL字段中使用逗号分隔符
  14. HTML Table导出EXCEL(支持大量数据,保留报表格式)
  15. Python入门学习笔记17(sqlalchemyd的使用)
  16. 补充下3月面试题(好未来、腾讯音乐、小药药)
  17. 修改服务器hba卡pciid,HBA卡更换步骤.doc
  18. Python在线聊天
  19. 期刊论文发表一般多久才可以EI检索
  20. Java Web项目中HTML文件中的汉字在浏览器中显示乱码的解决方案

热门文章

  1. HTML5 required是必填
  2. vijos 1067 Warcraft III 守望者的烦恼 矩阵
  3. Linux学习笔记--文件夹结构
  4. HTML rel 属性
  5. SharePoint 2007 开发系列(14) 调试sharepoint web part
  6. 理解C# 3.0的五项主要改进
  7. 对于长度为5位的一个01串,每一位都可能是0或1,一共有32种可能。
  8. python如何绘制直线_python绘制直线的方法
  9. web浏览器_vs2019使用webview2开发web浏览器 - 左正
  10. 计算机技术是双证,计算机技术在职研究生单证可以转双证吗