工程实践常用命令

 

ROS:

rostopic:

rostopic bw     显示主题使用的带宽
rostopic delay  显示带有 header 的主题延迟
rostopic echo   打印消息到屏幕
rostopic find   根据类型查找主题
rostopic hz     显示主题的发布频率
rostopic info   显示主题相关信息
rostopic list   显示所有活动状态下的主题
rostopic pub    将数据发布到主题
rostopic type   打印主题类型

 

rosmsg
rosmsg show    显示消息描述
rosmsg info    显示消息信息
rosmsg list    列出所有消息
rosmsg md5    显示 md5 加密后的消息
rosmsg package    显示某个功能包下的所有消息
rosmsg packages    列出包含消息的功能包

 

将rosbag包中的 激光点云数据 转换为pcd数据:

话题名转为pcd,命名是 时间戳.pcd

rosrun pcl_ros pointcloud_to_pcd input:=/rslidar_points  ./目录

bag包转为pcd

rosrun pcl_ros bag_to_pcd out_2020-01-24-16-42-05.bag /laser_cloud_surround ./pcd  

重命名某topic话题:

rosbag play --clock 2021-10-25-09-02-09.bag /test_cloud:=/points_raw

截取某个时间段的rosbag包,或者过滤话题:参考

1过滤单个topic

rosbag filter input.bag only-tf.bag "topic == '/tf'"

 

2过滤多个topic

rosbag filter input.bag output.bag "topic == '/velodyne_point_cloud' or topic =='/visensor/imu' or topic == '/visensor/left/image_raw'"

 

3.根据时间过滤

rosbag filter input.bag output.bag "t.to_sec() <= 1284703931.86"

 

4.同时过滤topic和时间

rosbag filter input.bag output.bag "topic == '/odometry/gps' and t.to_sec() <= 1284703931.86"

 

5.多个topic和时间

rosbag filter input.bag output.bag "(topic == '/velodyne_point_cloud' or topic =='/visensor/imu' or topic == '/visensor/left/image_raw') and (t.to_sec() >= 1506117983.884751 and t.to_sec() <= 1506118069.884751)"

 

 

编译某个特定包:

catkin_make -DCATKIN_WHITELIST_PACKAGES="ndt_omp"

catkin_make -DCATKIN_WHITELIST_PACKAGES="ndt_omp;lidar_imu_calib" 

 

git clone

使用国内镜像,目前已知Github国内镜像网站有github.com.cnpmjs.org和git.sdut.me。

速度根据各地情况而定,在clone某个项目的时候将github.com替换为github.com.cnpmjs.org即可。

 

ubuntu访问github

1.打开终端命令行,输入命令:sudo gedit /etc/hosts       打开hosts文件,修改里面的内容如下

127.0.0.1    localhost
127.0.1.1    intasect-HP-Desktop-Pro-G2-MT
xxx.xxx.xxx.xxx github.com git
13.250.177.223 github.com
# github.com
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
151.101.113.194 github.global.ssl.fastly.net
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
View Code

2.有的同学虽然加入了github的相关ip信息,却还是无法访问,这是因为ubuntu系统的安全性问题,还需要在 127.0.0.1 localhost 后面追加

xxx.xxx.xxx.xxx github.com git
13.250.177.223 github.com

上面的xxx.xxx.xxx.xxx 是本机的ipv4地址 ifconfig, 13.250.177.223  是利用站长工具,获取的github数据库的ipv4地址。

站长工具:http://tool.chinaz.com/dns?type=1&host=&ip=

3.修改完后,点击保存。打开浏览器,输入:https://github.com/   ,能够成功访问啦!

 

 

串口:

罗列:ls /dev/ttyUSB*
罗列:ls -l /dev/ttyS*
激活:sudo chmod 777 /dev/ttyUSB0

 

 

cloudcompare.ccViewer
cloudcompare.CloudCompare

 

 source ./devel/setup.bash

roslaunch rslidar_sdk start.launch 

rosrun imu_parse imu_parse

 

rostopic record /rslidar_points /imu

 

创建软链接

1,虚假的软连接 ln -s '文件' '文件' 

 2,真实的软连接

/usr/share/applications$ sudo vim Mydata.desktop

XMind.desktop

[Desktop Entry]
Version=1.0
Type=Link
Name=XMind
Comment=XMind file
URL=file:///home/l/beifen/xmind-8-update8-linux/XMind_amd64/
Icon=folder
X-Ubuntu-Gettext-Domain=example-content

MyCode.desktop

[Desktop Entry]
Version=1.0
Type=Link
Name=MyCode
Comment=MyCode file
URL=file:///home/l/code
Icon=folder
X-Ubuntu-Gettext-Domain=example-content
View Code

 

 卸载gtsam库

Generally having a make uninstall command is a bad idea, since due to different user configurations it is hard to specify what should be uninstalled.

The foolproof way is to go to your build directory and run xargs rm -rf < install_manifest.txt.

 

 

 

 

 

 

posted @ 2021-11-05 15:59  ashuo  阅读(104)  评论(0编辑  收藏  举报