松灵机器人地盘 安装 ros 驱动 并且 发布ros 指令进行控制

安装驱动

复制代码
$ cd ~/catkin_ws/src
$ git clone https://github.com/agilexrobotics/ugv_sdk.git  
$ git clone https://github.com/agilexrobotics/scout_ros.git
$ cd ..
$ catkin_make

安装

● 使能 gs_usb 内核模块

● 设置 500k 波特率和使能 can-to-usb 适配器

复制代码
sudo modprobe gs_usb
sudo ip link set can0 up type can bitrate 500000
sudo apt install can-utils
roslaunch scout_bringup scout_robot_base.launch

启动成功后 是这样

复制代码
RTNETLINK answers: Device or resource busy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
can-utils is already the newest version (2018.02.0-1).
0 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
... logging to /home/lg/.ros/log/6a676b6a-f5ee-11ef-a0ac-24ec992f7fe4/roslaunch-lg-scout-3667.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://lg-scout:41271/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.13
 * /scout_base_node/base_frame: base_link
 * /scout_base_node/is_scout_mini: False
 * /scout_base_node/is_scout_omni: False
 * /scout_base_node/odom_frame: odom
 * /scout_base_node/odom_topic_name: odom
 * /scout_base_node/port_name: can0
 * /scout_base_node/pub_tf: False
 * /scout_base_node/simulated_robot: False

NODES
  /
    scout_base_node (scout_base/scout_base_node)

auto-starting new master
process[master]: started with pid [3677]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 6a676b6a-f5ee-11ef-a0ac-24ec992f7fe4
process[rosout-1]: started with pid [3688]
started core service [/rosout]
process[scout_base_node-2]: started with pid [3691]
[ INFO] [1740758981.233051051]: Working as scout mini: 0
[ INFO] [1740758981.233888549]: Working as scout omni: 0
Start listening to port: can0
Detected protocol: AGX_V2
Start listening to port: can0
[ INFO] [1740758981.297304150]: Using CAN bus to talk with the robot

发指令前进

复制代码
rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear: {x: -1, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}'

这样小车就动起来了

还可以用python 发指令

复制代码
#!/usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist

rospy.init_node('velocity_commander')
pub = rospy.Publisher('/cmd_vel', Twist, queue_size=10)

rate = rospy.Rate(10)  # 10Hz
while not rospy.is_shutdown():
    cmd = Twist()
    cmd.linear.x = 3  # 前进速度 0.2 m/s
    cmd.angular.z = 0 # 旋转角速度 0.5 rad/s
    pub.publish(cmd)
    rate.sleep()

还可以 用键盘控制

复制代码
source ./devel/setup.sh 
roslaunch scout_bringup scout_teleop_keyboard.launch

.. logging to /home/lg/.ros/log/6a676b6a-f5ee-11ef-a0ac-24ec992f7fe4/roslaunch-lg-scout-3917.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://lg-scout:40907/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.13
 * /teleop_keybord/repeat_rate: 50.0

NODES
  /
    teleop_keybord (teleop_twist_keyboard/teleop_twist_keyboard.py)

ROS_MASTER_URI=http://localhost:11311

process[teleop_keybord-1]: started with pid [3932]

Reading from the keyboard  and Publishing to Twist!
---------------------------
Moving around:
   u    i    o
   j    k    l
   m    ,    .

For Holonomic mode (strafing), hold down the shift key:
---------------------------
   U    I    O
   J    K    L
   M    <    >

t : up (+z)
b : down (-z)

anything else : stop

q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%

CTRL-C to quit

currently:	speed 0.5	turn 1.0 

按 U I O

J K L

M < > 可以运行

相关推荐
曹勖之5 小时前
在 UE5 蓝图中配置Actor类型的Asset以作为位置和旋转设置目标
ue5·机器人
曹勖之5 小时前
UE 5 和simulink联合仿真,如果先在UE5这一端结束Play,过一段时间以后**Unreal Engine 5** 中会出现显存不足错误
matlab·ue5·机器人
曹勖之8 小时前
撰写脚本,通过发布/joint_states话题改变机器人在Rviz中的关节角度
开发语言·python·机器人·ros2
奔跑吧邓邓子11 小时前
DeepSeek 赋能智能养老:情感陪伴机器人的温暖革新
人工智能·机器人·deepseek·智能养老·情感陪伴
VR最前沿14 小时前
全新Xsens Animate版本是迄今为止最大的软件升级,提供更清晰的数据、快捷的工作流程以及从录制开始就更直观的体验
人工智能·科技·机器人·自动化
CHOTEST中图仪器14 小时前
激光干涉仪:解锁协作机器人DD马达的精度密码
机器人·激光干涉仪
Tisfy15 小时前
LeetCode 2434.使用机器人打印字典序最小的字符串:贪心(栈)——清晰题解
leetcode·机器人·字符串·题解·贪心·
敢敢のwings15 小时前
论文速读《DexWild:野外机器人策略的灵巧人机交互》
机器人·人机交互
AiTEN_Robotics1 天前
仓库自动化搬运:自动叉车与AGV选型要点及核心技术解析
人工智能·机器人·自动化
FREEDOM_X1 天前
新版NANO下载烧录过程
ubuntu·机器人