-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlaunch_commands.txt
484 lines (336 loc) · 15.5 KB
/
launch_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
ls /dev/ttyUSB* -l
sudo chmod 777 /dev/ttyUSB0
roslaunch p2os_launch p2os_teleop_joy.launch
roslaunch teleop_twist_joy teleop.launch
rosrun rosaria RosAria
rosrun rosaria_client interface
roslaunch openni_launch openni.launch depth_registration:=true
rosrun image_view image_view image:=/camera/rgb/image_color
rosrun tf static_transform_publisher 0.2 0 0.45 0 0 0 base_link camera_link 100
roslaunch rtabmap_ros rtabmap_transform.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=false frame_id:=/base_link odom_topic:=/pose rviz:=true rtabmapviz:=true
roslaunch rtabmap_ros rtabmap_transform.launch localization:=true visual_odometry:=false frame_id:=/base_link odom_topic:=/pose rviz:=true rtabmapviz:=true
roslaunch move_base move_base.launch
rosrun rviz rviz
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" rviz:=true rtabmapviz:=true
roslaunch rtabmap_ros rtabmap.launch localization:=true rviz:=true rtabmapviz:=true
rosrun rtabmap_ros rtabmap --params # parameters
rtabmap_args:="--delete_db_on_start" # should need to be passed, it won't delete db automatically
## Changes in the rtabmap.launch
<param name="frame_id" type="string" value="base_link"/>
<remap from="odom" to="/base_controller/odom"/>
or
<remap from="odom" to="/pose"/>
or
<arg name="odom_topic" default="pose"/>
$ rostopic info /rtabmap/odom
Type : nav_msgs/Odometry
Publishers:
/rtabmap/rgbd_odometry
Subscribers:
/rtabmap/rtabmapviz
/rtabmap/rtabmap
$ rosrun rqt_graph rqt_graph # visualize
$ rostopic info /pose
position(visual_odometry/short term) v/s trajectory(loop closure/long term)
# Error in transformations for wheel odometry
$ rosrun tf view_frames && evince frames.pdf
$ rosrun tf tf_echo <source> <target> # Tsource_target == target wrt source
launch file -> sequentially launches
#/base_link -> rotational center
# 2D Pose Estimate -> positon and orientation
# 2D Navigation Goal
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=false frame_id:=/base_link odom_topic:=/pose rviz:=true rtabmapviz:=true
# Navigation -> nav_msgs/OccupancyGrid -> Laser
# fusing similar to turtlebot
# static transform between camera_link and base_link -> kinect_odometry.launch
# difference between frame_id and odom_frame_id and visual_odometry need to be set false
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=true odom_topic:=/pose rviz:=true rtabmapviz:=true
# Static transform publisher:
<launch>
<!-- x(in m) y z yaw(in rad) pitch roll -- >
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="1 0 0 0 0 0 1 link1_parent link1 100" />
</launch>
$ rosrun tf static_transform_publisher
x y z yaw pitch roll frame_id child_frame_id period_in_ms
$ rosrun tf static_transform_publisher 0.2 0 0.45 0 0 0 base_link camera_link 100
# argument -> passed through command line ; param -> set up on launch file
# demo:
$ roslaunch rtabmap_ros rgbdslam_datasets.launch
~/data$ rosbag play --clock -d 5 -r 0.5 rgbd_dataset_freiburg3_long_office_household.bag
# Loop closure:
$ rostopic echo /rtabmap/info/loopClosureId
$ rosrun rtabmap_ros rtabmap --params
# Optimizer\Strategy=0 # TORO
# Optimizer\VarianceIgnored=true # high covariance in /pose
# Reg\Force3Dof=true # x,y,yaw
<param name="Reg/Force3Dof" value="true"/>
<param name="Optimizer/Slam2D" value="true"/>
<param name="Optimizer/Strategy" value="0"/>
<param name="Optimizer/VarianceIgnored" value="0"/>
# scan
<param name="subscribe_scan" type="bool" value="true"/>
<!-- Navigation stuff (move_base) -->
<include unless="$(arg simulation)" file="$(find turtlebot_bringup)/launch/3dsensor.launch">
<arg if="$(arg sw_registered)" name="depth_registration" value="false"/>
<arg unless="$(arg sw_registered)" name="depth_registration" value="true"/>
</include>
<include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
roslaunch rtabmap_ros rtabmap_transform.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=false frame_id:=/base_link odom_topic:=/pose subscribe_scan:=true rviz:=true rtabmapviz:=true
roslaunch rtabmap_ros rtabmap_transform.launch localization:=true subscribe_scan:=true visual_odometry:=false frame_id:=/base_link odom_topic:=/pose rviz:=true rtabmapviz:=true
# change demo_turtlebot_mapping.launch < rtabmap_transform.launch
$ roslaunch rtabmap_ros demo_turtlebot_mapping_transform.launch
# c++11 errors in CmakeLists.txt -> catkin_make
# rostopic pub move_base/goal messg_type
# rosparam get <parameter>
# Global planner: /move_base/NavfnROS/plan
# Local planner: /move_base/DWAPlannerROS/local..
# Rosbag record
rosbag record -O subset /turtle1/cmd_vel /turtle1/pose
# Topics: /rtabmap/rtabmap subscribed to (approx sync):
rosbag record -O rrc1 /pose /camera/rgb/image_rect_color /camera/depth_registered/image_raw /camera/rgb/camera_info /tf
Visual odometry:
rosbag record -O rrc1a /camera/rgb/image_rect_color /camera/depth_registered/image_raw /camera/rgb/camera_info /tf
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" rtabmapviz:=true use_sim
_time:=true
rosbag play --clock rrc1a.bag -d 5 -r 0.8
ssh udit@10.2.36.224
[Password: udit]
scp rrc2.bag udit@10.2.36.224:~
vim escape -> : q!
RGBD/ENABLED=1
Frame rate of the sensor
Loop/Highest_hypothesis_value -> >= 0.11
<node pkg="rtabmap_ros" type="rtabmap" name="rtabmap">
<!-- Disable ICP refining -->
<!-- v0.10 --> <param name="LccIcp/Type" type="string" value="0"/> <!-- 0=No ICP, 1=ICP 3D, 2=ICP 2D -->
<!-- v0.11 --> <param name="Reg/Strategy" type="string" value="0"/> <!-- 0=Vis, 1=Icp, 2=VisIcp -->
<!-- Decrease ICP correspondence ratio to 15% for example -->
<!-- v0.10 --> <param name="LccIcp2/CorrespondenceRatio" type="string" value="0.15"/>
<!-- v0.11 --> <param name="Icp/CorrespondenceRatio" type="string" value="0.15"/>
</node>
<param name="RGBD/OptimizeMaxError" type="double" value="0.1" /> # Increase it
Icp/CorrespondenceRatio = 0.2 # [Max distance for point correspondences.] Default: 0.1
RGBD/OptimizeMaxError = 1.5 # Default: 1 [Reject loop closures if optimization error ratio is greater than this value]
Default:
Vis/MinInliers = "20" # Minimum feature correspondences to compute/accept the transformation.
Vis/InlierDistance = "0.1" # [Vis/EstimationType = 0] Maximum distance for feature correspondences. Used by 3D->3D estimation approach
rqt_plot /pose/twist/twist/linear/x /cmd_vel/linear/x
df -h
sudo du -cha --max-depth=1 | grep -E "M|G"
# Real time gpu monitor
watch -n 1 nvidia-smi
# internal ip address
ip route get 8.8.8.8 | awk '{print $NF; exit}'
sudo service ssh restart
tmux attach-session -t <session-name>
tmux list-sessions
tmux new -s <session-name>
#internet restart
sudo service network-manager restart
# installed packages
apt list --installed | grep -i <PACKAGE>
apt -qq list <PACKAGE>
# locally visualizing markdown file
$ grip <path_to_markdown_file>
# Realsense Handheld
# Launch
roslaunch realsense2_camera rs_camera.launch align_depth:=true
# Installing realsense2:
export ROS_VER=kinetic
sudo apt-get install ros-$ROS_VER-realsense2-camera ros-$ROS_VER-realsense2-description
# Mapping
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info
# Recording to rosbag
rosbag record -O data1 /camera/aligned_depth_to_color/image_raw /camera/color/image_raw/compressed /camera/color/camera_info /tf_static
# Process kill
$ pgrep <process_name>
$ kill <pid>
# Creating virtualenv
$ virtualenv [options] <environment-variable>
# --system-site-packages : depends on global /usr/lib/python2.7/
$ virtualenv --system-site-packages -p python3 venv
$ source ./venv/bin/activate
$ pip list
$ source ~/softwares/tensorflow/venv/bin/activate # $ start_tf
$ source ~/softwares/tensorflow3/venv3/bin/activate # $ start_tf3
$ deactivate
# [Not using/using] system packages
# [rm/touch] tensorflow3/venv3/lib/python3.5/no-global-site-packages.txt
# ipsc commands
$ ssh ipsc19@abacus.iiit.ac.in
$ xXkK_oIL
$ mpicc file.c -o file.out
$ mpirun -np 10 file.out
$ sbatch ipsc_job.sh # <output> slurm-<jobid>
$ squeue
# ada commands
ssh ipsc11@ada.iiit.ac.in
gRVENTo7
sint2
nvcc file.cu
# Undo the last commit before pushing to the server
$ git commit -m "Something terribly misguided"
$ git reset HEAD~
<< edit files as necessary >>
$ git add .
$ git commit -c ORIG_HEAD
# Detecting SSD: 0 -> SSD and 1 -> HDD
$ lsblk -d -o name,rota
$ df -h
# Laptop model number
$ sudo dmidecode | grep -A 9 "System Information"
$ sudo dmidecode | less
# Backup of large files with progress bar - tar
$ cd /media/hard_disk
$ tar czf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz
# Copying with progress bar - rsync
$ rsync -r --human-readable --no-i-r --info=progress2 --info=name0 /source/folder /destination/folder
# Resume rsync
$ rsync -r --partial-dir=.rsync-partial --human-readable --no-i-r --info=progress2 --info=name0 /source/folder /destination/folder
# OpenCV Types
+--------+----+----+----+----+------+------+------+------+
| | C1 | C2 | C3 | C4 | C(5) | C(6) | C(7) | C(8) |
+--------+----+----+----+----+------+------+------+------+
| CV_8U | 0 | 8 | 16 | 24 | 32 | 40 | 48 | 56 |
| CV_8S | 1 | 9 | 17 | 25 | 33 | 41 | 49 | 57 |
| CV_16U | 2 | 10 | 18 | 26 | 34 | 42 | 50 | 58 |
| CV_16S | 3 | 11 | 19 | 27 | 35 | 43 | 51 | 59 |
| CV_32S | 4 | 12 | 20 | 28 | 36 | 44 | 52 | 60 |
| CV_32F | 5 | 13 | 21 | 29 | 37 | 45 | 53 | 61 |
| CV_64F | 6 | 14 | 22 | 30 | 38 | 46 | 54 | 62 |
+--------+----+----+----+----+------+------+------+------+
> CV_8U -> 0-255
> CV_32F -> 0-1.0
> Write / display -> CV_8U
> img.type()
> for(i = 1:rows)
> for(j = 1:cols)
> img.at<uchar>(i,j)
# Download wget
$ wget url -q --show-progress
# Passing output from cmd2 as parameter to cmd1
cmd1 -options $(cmd2)
# Example
du -cha $(sudo find . -iname "*.bag")
# Checking whether ubuntu detected hard disk or not
ls /dev/ | grep sd # Do it with and without hard disk plugged
# Mounting device
sudo ntfsfix /dev/sdb1 # Only if error in mounting
sudo fdisk -l # Assuming device at /dev/sdb1
sudo mount -t ntfs /dev/sdb1 /media
# Sourcing tmux
tmux source ~/.tmux.conf
# Opencv conflict between ROS and python3
export PYTHONPATH="/home/cair/softwares/tensorflow3/venv3/lib/python3.5/site-packages":$PYTHONPATH
# Undoing python3 and switching back to python2
export PYTHONPATH="" && source ~/.bashrc
# Using cv2 - 4.1.1 in virtual environment
# Run this inside virtual env
export PYTHONPATH="/home/cair/softwares/tensorflow3/venv3/lib/python3.5/site-packages":$PYTHONPATH
# List to numpy array
npArray = np.asarray(list)
# realsense-viewer error : undefined symbol: libusb_get_parent
$ which realsense-viewer
$ ldd realsense-viewer | grep libusb
$ mv /opt/mvIMPACT_Acquire/lib/x86_64/libusb-1.0.so.0 ~/backup/
# Force “git push” to overwrite remote files as well remote commits
git push -f origin master
# Undoing the git push to github:
git push -f origin HEAD^:master
# Passing output from one command as input to another command
cmd1 -arg1 $(cmd2 -arg2)
# Creating symbolic link
ln -s source_file link
# RTABMAP problem of libfreenect*.so.* or librealsense*.so.*
ldd catkin_ws/devel/lib/rtabmap_ros/rtabmap | grep not # To see what links are missing
# For installing libfreenect*.so.*
$ sudo apt-get install ros-kinetic-rtabmap ros-kinetic-rtabmap-ros
$ sudo apt-get remove ros-kinetic-rtabmap ros-kinetic-rtabmap-ros
# Install librealsense*.so.* from synaptic
# Problem of RTABMAP for particular librealsense*.so* file
# rtabmap: error while loading shared libraries: librealsense2.so.2.30: cannot open shared object file:
No such file or directory
# WITH_REALSENSE2 = OFF # Set in ccmake of rtabmap/build
# Remapping a topic
# Published topic: "hello". Wanted topic: "chatter"
$ <remap from="chatter" to="hello"/> # Inside launch file
# TF problem while working with Bagfiles
1. `rosparam set use_sim_time true` $ Ensuring all nodes use same time
2. `rosbag play <file.bag> --clock` $ To use simulation time
3. `rosrun tf static_transform_publisher
x y z yaw pitch roll frame_id child_frame_id period_in_ms` $ tf would also be published in simulated time
4. `roslaunch rtabmap_ros rtabmap.launch` $ Launch any node using rosbag topics and static tf info
# Compressing/Extracting using terminal
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
tar -xzvf archive.tar.gz
# Extracting file compressed using Ubuntu GUI:
tar xf data.tar
# Concatanating csv files with excluding header of first one
sed 1d img_pairs*.csv > img_pairs_comb.csv
# wget downloading of a directory:
wget -r -nH --cut-dirs=2 --no-parent --reject="index.html*" <url>
# Downloading ScanNet:
wget -r -A .sens -I /ScanNet/v2/scans/scene000*,/ScanNet/v2/scans/scene001*,/ScanNet/v2/scans/scene002*,/ScanNet/v2/scans/scene003*,/ScanNet/v2/scans/scene004* -nH --cut-dirs=3 --no-parent --reject="index.html*" http://datasets.rrc.iiit.ac.in/ScanNet/v2/scans/
# Killing process by its name:
kill $(pgrep python)
kill $(pgrep <process_name>)
# Opening Nerdtree from a file:
:NERDTreeFocus
# Using SIFT with opencv:
pip uninstall opencv-python opencv-contrib-python
pip install opencv-python==3.4.2.16 opencv-contrib-python==3.4.2.16
# Reverting git add
git reset file
# Reverting git commit
git reset --soft HEAD~1
# Editing git config for username and email-id
git config --local user.name UditSinghParihar
git config --local user.email uditsinghparihar96@gmail.com
# Debugging cuda error:
CUDA_LAUNCH_BLOCKING=1 python [YOUR_PROGRAM]
# Restarting sftp for neon server:
1. Close the remote files open in sublime.
2. ps aux | grep sftp
3. kill <neon_server_pid>
# Changing remote url to forked branch:
git remote set-url origin https://github.com/user/FORK.git
# Creating a new repository out of an original repository after commiting changes
1. Clone the original repository.
2. Create a new repository.
3. Change the remote url for pushing changes, in local repository to the newly
created repository.
4. Push the commits in local repository.
# Changing access time and creation of all files recursively in a directory:
find /path/to/dir -exec touch {} \;
# Seeing access time:
ls -ul file.txt
# Seeing all files having access time older than 10 days:
find /path/to/dir -atime +10
# Mounting remote directory
sudo mkdir /mnt/blue_scratch
sudo sshfs -o allow_other udit@blue.iiit.ac.in:/scratch/udit/ /mnt/blue_scratch
sudo sshfs -o allow_other udit@blue.iiit.ac.in:/home/udit/ /mnt/blue
# Debugging sshfs
sudo umount -l /mnt/blue
killall sshfs
# Open3d normals calculation:
pip uninstall open3d open3d-python
pip install open3d==0.9.0.0
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30))
# Kill file manager processes
nautilus -q
Accessing tensorBoard on local machine while training on server:
1. `ssh -L localhost:16006:localhost:6006 udit@blue.iiit.ac.in`
2. `tensorboard --logdir runs/` # On Server
3. `http://localhost:16006/` # On Local machine
# Increasing number of open files limit in np.load:
ulimit -n 4096
# Keyboard enable/disable
xinput list
xinput float 12
xinput reattach 12 3
# OpenCV color space:
`imread`, `imwrite` and `imshow` uses BGR order
im_rgb = cv2.cvtColor(im_cv, cv2.COLOR_BGR2RGB)
# Matplotlib color space:
matplotlib's `imshow` uses RGB order