1. /usr/bin/env: “python”: 没有那个文件或目录
终端输入:sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1000
2. Error: package 'pkg_test1' not found
终端输入:source ~/catkin_ws/devel/setup.bash
或者
gedit ~/.bashrc
(或者用vi等打开也可以),打开 .bashrc文件,在文件最后添加source ~/catkin_ws/devel/setup.bash
3. 发布者节点声明函数
rospy.Subscriber('student_info', Student, callback)
,第一个参数为话题明,第二个为数据类型,第三个为回调函数
rospy.Publisher('student_info', Student, queue_size=10)
,第一个参数为话题明,第二个为数据类型,第三个为缓冲队列长度
3. ubuntu虚拟机安装pyserial(提示没有serial模块)
你可以直接在终端下通过pip安装下载: pip install pyserial
4. 安装pip命令(提示Command 'pip' not found, but there are 18 similar ones)
第一步:apt-get install python3-pip
第二步:sudo apt-get install python3-pip
第三步:sudo wget
http://bootstrap.pypa.io/get-pip.py
第四步:sudo python3.8 get-pip.py
5. 如何做到实时控制电机状态
使用rostopic pub -1 话题明 话题数据类型值
6. 编译某个指定包
catkin_make -DCATKIN_WHITELIST_PACKAGES="wushua_serial"
此后再编译所有包:catkin_make -DCATKIN_WHITELIST_PACKAGES=""
7. 启动ros moveit配置向导
rosrun moveit_setup_assistant moveit_setup_assistant
8. Linux查串口号
ls -l /sys/class/tty/ttyUSB*
9. 使用moveit_setup_asisstant制作的moveit_config包中各.luanch文件的效果
(1) XXX.launch.xml:无法启动,但是其他.launch文件的依赖
(2) default_warehouse_db.launch:无法启动
(3) demo_gazebo.launch:可以启动,但gazebo显示错乱,需要调整
(4) demo.launch:可以启动,运行moveit
(5) gazebo.launch:可以启动,但gazebo显示错乱,需要调整
(6) joystick_control.launch:无法启动
(7) move_group.launch:无法启动
(8) moveit_rviz.launch:可以启动,出现Rviz界面,但无法显示机器人模型,需要调整
(9) planning_context.launch:无法启动
(10) ros_controllers.launch:无法启动
(11) run_benchmark_ompl.launch:无法启动
(12) setup_assistant.launch:可以启动,运行moveit_setup_assistant
(13) warehouse.launch:无法启动
10. 打开/dev/ttyUSB0 权限不够 permission denided
将用户名加入dialout用户组,因为默认情况下只有root用户才有权操作tty设备
sudo adduser USER_NAME dialout
其中 USER_NAME 是当前登录系统的用户名