ros常見錯誤及解決辦法 長期更

2021-09-21 13:52:47 字數 2624 閱讀 7093

這時我們需要在py程式前加上:

#!/usr/bin/env python
目的是在執行python指令碼的時候告訴作業系統我們要用python直譯器去執行py指令碼

$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

$ source ~/.bashrc

catkin_ws是當前工作空間,執行時換成自己的。

錯誤原因:是因為***.py中有中文字元。

解決方法:

# coding=gbk
#  -*-coding:utf8 -*-
the config file 『/opt/ros/hydro/share/urdf_tutorial/urdf.vcg』 is a .vcg file, which is the old rviz config format.

解決辦法是:

由於文中指定使用.vcg格式的檔案引起,將base.urdf.rviz.launc**件的內容做如下更改後可以正常執行

>

name

="model"

/>

name

="gui"

default

="false"

/>

name

="robot_description"

textfile

="$(find smartcar_description)/urdf/smartcar.urdf"

/>

name

="use_gui"

value

="$(arg gui)"

/>

name

="joint_state_publisher"

pkg="joint_state_publisher"

type

="joint_state_publisher"

>

node

>

name

="robot_state_publisher"

pkg="robot_state_publisher"

type

="state_publisher"

/>

name

="rviz"

pkg="rviz"

type

="rviz"

args

="-d $(find urdf_tutorial)/urdf.rviz"

/>

launch

>

原因是:由於joint_state_publisher 未能解析urdf.xml檔案而出錯。

解決辦法:因此把urdf檔案中第一行**<?xml version="1.0"?>去掉,問題也解決了。

[ 33%] built target rosgraph_msgs_generate_messages_py

../catkin_generated/env_cached.sh: 16: exec: /home/daniel/ros_learning/smartcar_description/src/readyaml/cfg/

test.cfg: permission denied

readyaml/cmakefiles/readyaml_gencfg.dir/build.make:63: recipe for target '/home/daniel/ros_learning/smartcar_

description/devel/include/readyaml/testconfig.h' failed

make[2]: *** [/home/daniel/ros_learning/smartcar_description/devel/include/readyaml/testconfig.h] error 126

cmakefiles/makefile2:1215: recipe for target 'readyaml/cmakefiles/readyaml_gencfg.dir/all' failed

make[1]: *** [readyaml/cmakefiles/readyaml_gencfg.dir/all] error 2

make[1]: *** 正在等待未完成的任務....

解決辦法:

根據提示使用ls -al命令檢視該檔案許可權

ls -al  /home/daniel/ros_learning/smartcar_description/src/readyaml/cfg/test.cfg
如果該檔案沒有x許可權時,使用chmod +x命令賦予檔案許可權

chmod +x /home/daniel/ros_learning/smartcar_description/src/readyaml/cfg/test.cfg
然後再重新編譯,就通過啦

rosrun rqt_joint_trajectory_controlr rqt_joint_trajectory_controller

Ruby常見錯誤及解決辦法

ruby常見錯誤及解決辦法 更新中.module test def add up x,y return x y endendputs add up 100,89 如上 執行出現以下兩個錯誤。錯誤1 class module name must be constant 解決方法 module名字tes...

HTTPS常見錯誤及解決辦法

問題 問題描述 解決方法 net err cert date invalid 的ssl證書有效期過期導致的 重新申請新的ssl證書 net err cert common name invalid 訪問的網域名稱和證書繫結的網域名稱不一致導致 請檢查訪問的網域名稱或者證書繫結的網域名稱是否相同 ne...

C 常見記憶體錯誤及解決辦法

發生記憶體錯誤是件非常麻煩的事情。編譯器不能自動發現這些錯誤,通常是在程式執行時才能捕捉到。而這些錯誤大多沒有明顯的症狀,時隱時現,增加了改錯的難度。有時使用者怒氣沖沖地把你找來,程式卻沒有發生任何問題,你一走,錯誤又發作了。常見的記憶體錯誤及其對策如下 記憶體分配未成功,卻使用了它。有三種情況 1...