---
# System prepended metadata

title: Jetson Orin AGX

---

Jetson Orin AGX
===

record 20240501
---

try ROS RTABMAP

    $ roslaunch realsense2_camera rs_camera.launch \
        align_depth:=true \
        unite_imu_method:="linear_interpolation" \
        enable_gyro:=true \
        enable_accel:=true
    $ rosrun imu_filter_madgwick imu_filter_node \
        _use_mag:=false \
        _publish_tf:=false \
        _world_frame:="enu" \
        /imu/data_raw:=/camera/imu \
        /imu/data:=/rtabmap/imu

    $ roslaunch rtabmap_launch rtabmap.launch \
        rtabmap_args:="--delete_db_on_start --Optimizer/GravitySigma 0.3" \
        depth_topic:=/camera/aligned_depth_to_color/image_raw \
        rgb_topic:=/camera/color/image_raw \
        camera_info_topic:=/camera/color/camera_info \
        approx_sync:=false \
        wait_imu_to_init:=true \
        imu_topic:=/rtabmap/imu \
        rtabmap_viz:=false
    
    
    $ tmux
    $ create new one: ctrl a c
    $ 切換 shift 方向左右
    $ delete: ctrl d
    
    
    $ roslaunch realsense2_camera rs_d400_and_t265.launch
    
    $ roslaunch rtabmap_launch rtabmap.launch \
        rtabmap_args:="--delete_db_on_start --Optimizer/GravitySigma 0.3" \
        depth_topic:=/d400/camera/aligned_depth_to_color/image_raw \
        rgb_topic:=/d400/camera/color/image_raw \
        camera_info_topic:=/d400/camera/color/camera_info \
        approx_rgbd_sync:=false \
        visual_odometry:=false \
        odom_topic:=/t265/odom/sample \
        frame_id:=t265_link \
        rtabmap_viz:=false \
        rgbd_sync:=true \
        subscribe_rgbd:=false \
        queue_size:=30
        
        
        
    $ roslaunch rtabmap_demos demo_robot_mapping.launch
    $ rosbag play --clock demo_mapping.bag
    
    $ rosbag record /rtabmap/cloud_ground /rtabmap/cloud_map /rtabmap/cloud_obstacles /rtabmap/scan_map /rtabmap/mapData /rtabmap/mapGraph /rtabmap/mapPath /rtabmap/info /tf /tf_static -O ./file.log
try VNC (failed)

        
    $ gsettings set org.gnome.Vino prompt-enabled false
    $ gsettings set org.gnome.Vino require-encryption false
    $ cd /usr/share/glib-2.0/schemas
    $ sudo cp org.gnome.Vino.gschema.xml org.gnome.Vino.gschema.xml.old
    $ sudo vi org.gnome.Vino.gschema.xml
   
``` java
<key name='enabled' type='b'>
  <summary>Enable remote access to the desktop</summary>
  <description>
          If true, allows remote access to the desktip via the RFB
          protocol. Users on remote machines may then connect to the
          desktop using a VNC viewer.
  </description>
  <default>false</default>
</key>
```
    vnc password may be password
    
    $ sudo glib-compile-schemas /usr/share/glib-2.0/schemas
    $ 
    
實驗要用的指令
---

1. 做實驗
``` sh
    $ tmux
    $ create new one: ctrl a c
    $ 切換 shift 方向左右
    $ delete: ctrl d
    
    $ roslaunch realsense2_camera rs_d400_and_t265.launch
    
    $ roslaunch rtabmap_launch rtabmap.launch \
        rtabmap_args:="--delete_db_on_start --Optimizer/GravitySigma 0.3" \
        depth_topic:=/d400/camera/aligned_depth_to_color/image_raw \
        rgb_topic:=/d400/camera/color/image_raw \
        camera_info_topic:=/d400/camera/color/camera_info \
        approx_rgbd_sync:=false \
        visual_odometry:=false \
        odom_topic:=/t265/odom/sample \
        frame_id:=t265_link \
        rtabmap_viz:=false \
        rgbd_sync:=true \
        subscribe_rgbd:=false \
        queue_size:=30
    
    $ rosbag record /rtabmap/cloud_ground /rtabmap/cloud_map /rtabmap/cloud_obstacles /rtabmap/scan_map /rtabmap/mapData /rtabmap/mapGraph /rtabmap/mapPath /rtabmap/info /tf /tf_static -O ./file.log
```

2. 回放

``` sh
    $ roscore
    $ rviz 
    $ rosbag play your-file-path
```

點rviz的那些topic就能收聽了，基本上是看這三個：

    /rtabmap/mapData 
    /rtabmap/mapGraph 
    /rtabmap/mapPath