Difference between revisions of "Turtlebot3 Waffle NUC Humble Testing 20240520"

From wikidb
Jump to: navigation, search
(save_map)
(save_map)
 
Line 255: Line 255:
 
   
 
   
 
   $ source scripts/save_map.sh temp20240707a
 
   $ source scripts/save_map.sh temp20240707a
[INFO] [1720377959.964604879] [map_saver]:  
+
        [INFO] [1720377959.964604879] [map_saver]:  
map_saver lifecycle node launched.  
+
    map_saver lifecycle node launched.  
Waiting on external lifecycle transitions to activate
+
    Waiting on external lifecycle transitions to activate
See https://design.ros2.org/articles/node_lifecycle.html for more information.
+
    See https://design.ros2.org/articles/node_lifecycle.html for more information.
[INFO] [1720377959.964874860] [map_saver]: Creating
+
        [INFO] [1720377959.964874860] [map_saver]: Creating
[INFO] [1720377959.965005147] [map_saver]: Configuring
+
        [INFO] [1720377959.965005147] [map_saver]: Configuring
[INFO] [1720377959.966359527] [map_saver]: Saving map from 'map' topic to '/home/eepp/maps/temp20240707a' file
+
        [INFO] [1720377959.966359527] [map_saver]: Saving map from 'map' topic to '/home/eepp/maps/temp20240707a' file
[WARN] [1720377959.966393435] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
+
        [WARN] [1720377959.966393435] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
[WARN] [1720377959.966402504] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
+
        [WARN] [1720377959.966402504] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
[WARN] [map_io]: Image format unspecified. Setting it to: pgm
+
        [WARN] [map_io]: Image format unspecified. Setting it to: pgm
[INFO] [map_io]: Received a 92 X 87 map @ 0.05 m/pix
+
        [INFO] [map_io]: Received a 92 X 87 map @ 0.05 m/pix
[INFO] [map_io]: Writing map occupancy data to /home/eepp/maps/temp20240707a.pgm
+
        [INFO] [map_io]: Writing map occupancy data to /home/eepp/maps/temp20240707a.pgm
[INFO] [map_io]: Writing map metadata to /home/eepp/maps/temp20240707a.yaml
+
        [INFO] [map_io]: Writing map metadata to /home/eepp/maps/temp20240707a.yaml
[INFO] [map_io]: Map saved
+
        [INFO] [map_io]: Map saved
[INFO] [1720377960.111512461] [map_saver]: Map saved successfully
+
        [INFO] [1720377960.111512461] [map_saver]: Map saved successfully
[INFO] [1720377960.113430786] [map_saver]: Destroying
+
        [INFO] [1720377960.113430786] [map_saver]: Destroying
eepp@adams:~$ ll maps/
+
total 36
+
  $ ll maps/
drwxrwxr-x  2 eepp eepp  4096 Jul  7 11:46 ./
+
        total 36
drwxr-x--- 28 eepp eepp  4096 Jun 29 09:35 ../
+
        drwxrwxr-x  2 eepp eepp  4096 Jul  7 11:46 ./
-rw-rw-r--  1 eepp eepp  8017 Jul  7 11:46 temp20240707a.pgm
+
        drwxr-x--- 28 eepp eepp  4096 Jun 29 09:35 ../
-rw-rw-r--  1 eepp eepp  129 Jul  7 11:46 temp20240707a.yaml
+
        -rw-rw-r--  1 eepp eepp  8017 Jul  7 11:46 temp20240707a.pgm
-rw-rw-r--  1 eepp eepp 10541 Jun 29 09:35 test01.pgm
+
        -rw-rw-r--  1 eepp eepp  129 Jul  7 11:46 temp20240707a.yaml
-rw-rw-r--  1 eepp eepp  123 Jun 29 09:35 test01.yaml
+
        -rw-rw-r--  1 eepp eepp 10541 Jun 29 09:35 test01.pgm
eepp@adams:~$ eog maps/test01.pgm ^C
+
        -rw-rw-r--  1 eepp eepp  123 Jun 29 09:35 test01.yaml
eepp@adams:~$ eog maps/temp20240707a.pgm &
+
[1] 5154
+
  
 
   $ eog maps/temp20240707a.pgm &
 
   $ eog maps/temp20240707a.pgm &
 +
        [1] 5154
  
 
== nav2 ==
 
== nav2 ==

Latest revision as of 10:55, 7 July 2024

Goals

Make adams work reliable at boot given the following HW configuration.

  • Use a wireless keyboard with an associate wireless mouse to free one USB port
  • An HDMI monitor
  • Use the OpenCR which will take the second USB port
  • The third USB port will be used by the Lidar version 1
  • This leaves two lightning ports
  • Using power brick that came with to box

The Setting

.bashrc

This are the known .bashrc setting required for bring up now

 $ tail .bashrc

       // Setup ROS Humble with turtlebot3 additionsselect 
       source /opt/ros/humble/setup.bash
       source ~/turtlebot3_ws/install/setup.bash

       // Setup the Turtlebot3 waffle
       export ROS_DOMAIN_ID=30 #TURTLEBOT3
       export LDS_MODEL=LDS-01
       export TURTLEBOT3_MODEL=waffle

Power Up

Keyboard Teleop

Gives confidence that the bashrc is setting up critical environmental variables and ROS. Major HW component are working and doing much of what we expect. OpenCR and the wheel drivers are working. The remote controler is working.

I had a little trouble with controlling the wheels. In particular, the keyboard_teleop didn't work. The following sequence turned out to be reliable. This is something to be debugged latter. In years past I booted the OpenCR and NUC simultaneously and also in any order.

Power up outline

  1. Power on the OpenCR board first
    1. wait for the boot finished chime
  2. Test the OpenCR by driving the wheels with Robotis controller
    1. Using the Robotis RC100B Controller 20240521
    2. This is an appropriate option when mapping. The waffle can be driven around the area of interest. More latter.
  3. Power up adams and log in
  4. In T1 bring up
   $ source scripts/bringup.sh
  1. in T2 bring up the keyboard teleop program
   $ source scripts/keyboard_teleop.sh

Bring up log details are at Turtlebot3_Waffle_NUC_Humble_Configure_20240426#Signs_of_Life_Test

LIDAR and RVIZ display

Termal 2


TBD

nodes

$ ros2 node list

 WARNING: Be aware that are nodes in the graph that share an exact name, this can have unintended side effects.
 /diff_drive_controller
 /hlds_laser_publisher
 /joint_state_publisher
 /robot_state_publisher
 /robot_state_publisher
 /rviz
 /transform_listener_impl_5a6d84b2c160
 /turtlebot3_node

RVIZ

  • TF
    • Show Name
    • Show Axes
    • Show Arros

TBD

ros2_graph

TBD

Graph

references

Install ros2_graph

eepp@adams:~$ pip install ros2-graph
Command 'pip' not found, but can be installed with:
sudo apt install python3-pip
eepp@adams:~$ python3 -V
Python 3.10.12




eepp@adams:~$ sudo apt install python3-pip -y
[sudo] password for eepp: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libwpe-1.0-1 libwpebackend-fdo-1.0-1 linux-headers-6.5.0-27-generic
  linux-hwe-6.5-headers-6.5.0-27 linux-image-6.5.0-27-generic
  linux-modules-6.5.0-27-generic linux-modules-extra-6.5.0-27-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  python3-wheel
The following NEW packages will be installed:
  python3-pip python3-wheel
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 1,337 kB of archives.
After this operation, 7,178 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 python3-wheel all 0.37.1-2ubuntu0.22.04.1 [32.0 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 python3-pip all 22.0.2+dfsg-1ubuntu0.4 [1,305 kB]
Fetched 1,337 kB in 1s (994 kB/s)      
Selecting previously unselected package python3-wheel.
(Reading database ... 352281 files and directories currently installed.)
Preparing to unpack .../python3-wheel_0.37.1-2ubuntu0.22.04.1_all.deb ...
Unpacking python3-wheel (0.37.1-2ubuntu0.22.04.1) ...
Selecting previously unselected package python3-pip.
Preparing to unpack .../python3-pip_22.0.2+dfsg-1ubuntu0.4_all.deb ...
Unpacking python3-pip (22.0.2+dfsg-1ubuntu0.4) ...
Setting up python3-wheel (0.37.1-2ubuntu0.22.04.1) ...
Setting up python3-pip (22.0.2+dfsg-1ubuntu0.4) ...
Processing triggers for man-db (2.10.2-1) ...




eepp@adams:~$ pip install ros2-graph
Defaulting to user installation because normal site-packages is not writeable
Collecting ros2-graph
  Downloading ros2_graph-0.0.5-py3-none-any.whl (26 kB)
Collecting argparse~=1.4.0
  Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting pyyaml~=6.0
  Downloading PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (705 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 705.5/705.5 KB 8.1 MB/s eta 0:00:00
Installing collected packages: argparse, pyyaml, ros2-graph
  WARNING: The script ros2_graph is installed in '/home/eepp/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed argparse-1.4.0 pyyaml-6.0.1 ros2-graph-0.0.5

Example Run


eepp@adams:~$ .local/bin/ros2_graph /diff_drive_controller
```mermaid
flowchart LR

/diff_drive_controller[ /diff_drive_controller ]:::main
/turtlebot3_node[ /turtlebot3_node ]:::node
/joint_state_publisher[ /joint_state_publisher ]:::node
/imu([ /imu<br>sensor_msgs/msg/Imu ]):::topic
/joint_states([ /joint_states<br>sensor_msgs/msg/JointState ]):::topic
/odom([ /odom<br>nav_msgs/msg/Odometry ]):::bugged


/imu --> /diff_drive_controller
/joint_states --> /diff_drive_controller
/diff_drive_controller --> /odom
/turtlebot3_node --> /imu
/turtlebot3_node --> /joint_states
/joint_state_publisher --> /joint_states




subgraph keys[<b>Keys<b/>]
subgraph nodes[<b><b/>]
topicb((No connected)):::bugged
main_node[main]:::main
end
subgraph connection[<b><b/>]
node1[node1]:::node
node2[node2]:::node
node1 o-.-o|to server| service[/Service<br>service/Type\]:::service
service <-.->|to client| node2
node1 -->|publish| topic([Topic<br>topic/Type]):::topic
topic -->|subscribe| node2
node1 o==o|to server| action{{/Action<br>action/Type/}}:::action
action <==>|to client| node2
end
end
classDef node opacity:0.9,fill:#2A0,stroke:#391,stroke-width:4px,color:#fff
classDef action opacity:0.9,fill:#66A,stroke:#225,stroke-width:2px,color:#fff
classDef service opacity:0.9,fill:#3B8062,stroke:#3B6062,stroke-width:2px,color:#fff
classDef topic opacity:0.9,fill:#852,stroke:#CCC,stroke-width:2px,color:#fff
classDef main opacity:0.9,fill:#059,stroke:#09F,stroke-width:4px,color:#fff
classDef bugged opacity:0.9,fill:#933,stroke:#800,stroke-width:2px,color:#fff
style keys opacity:0.15,fill:#FFF
style nodes opacity:0.15,fill:#FFF
style connection opacity:0.15,fill:#FFF

```

not

 epp@adams:~$ ros2 run ros2_graph
     usage: ros2 run [-h] [--prefix PREFIX] package_name executable_name ...
     ros2 run: error: the following arguments are required: executable_name, argv

Testing Scripts

bringup

 $ cat scripts/bringup.sh 
       #!/bin/bash
       # ece

       ros2 launch turtlebot3_bringup robot.launch.py

keyboard teleop

 $ cat scripts/keyboard_teleop.sh 
       #!/bin/bash
       # ece

       ros2 run turtlebot3_teleop teleop_keyboard

make_map

 $ cat scripts/make_map.sh 
       #!/bin/bash
       # ece
 
       ros2 launch turtlebot3_cartographer cartographer.launch.py

save_map

 $ cat scripts/save_map.sh 
       #!/bin/bash
       # ece
       #
       # save_map <map name>

       if [ $# -eq 1 ]
         then
           ros2 run nav2_map_server map_saver_cli -f ~/maps/$1
         else
           echo "save_map <map name>"
       fi
 $  

 $ source scripts/save_map.sh temp20240707a
       [INFO] [1720377959.964604879] [map_saver]: 

map_saver lifecycle node launched. Waiting on external lifecycle transitions to activate See https://design.ros2.org/articles/node_lifecycle.html for more information.

       [INFO] [1720377959.964874860] [map_saver]: Creating
       [INFO] [1720377959.965005147] [map_saver]: Configuring
       [INFO] [1720377959.966359527] [map_saver]: Saving map from 'map' topic to '/home/eepp/maps/temp20240707a' file
       [WARN] [1720377959.966393435] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
       [WARN] [1720377959.966402504] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
       [WARN] [map_io]: Image format unspecified. Setting it to: pgm
       [INFO] [map_io]: Received a 92 X 87 map @ 0.05 m/pix
       [INFO] [map_io]: Writing map occupancy data to /home/eepp/maps/temp20240707a.pgm
       [INFO] [map_io]: Writing map metadata to /home/eepp/maps/temp20240707a.yaml
       [INFO] [map_io]: Map saved
       [INFO] [1720377960.111512461] [map_saver]: Map saved successfully
       [INFO] [1720377960.113430786] [map_saver]: Destroying

 $ ll maps/
       total 36
       drwxrwxr-x  2 eepp eepp  4096 Jul  7 11:46 ./
       drwxr-x--- 28 eepp eepp  4096 Jun 29 09:35 ../
       -rw-rw-r--  1 eepp eepp  8017 Jul  7 11:46 temp20240707a.pgm
       -rw-rw-r--  1 eepp eepp   129 Jul  7 11:46 temp20240707a.yaml
       -rw-rw-r--  1 eepp eepp 10541 Jun 29 09:35 test01.pgm
       -rw-rw-r--  1 eepp eepp   123 Jun 29 09:35 test01.yaml
 $ eog maps/temp20240707a.pgm &
       [1] 5154

nav2

 $ cat scripts/nav2.sh 
        #!/bin/bash
        # ece
        #
        # nav2 <map name>

        if [ $# -eq 1 ]
          then
            ros2 launch turtlebot3_navigation2 navigation2.launch.py map:=$HOME/maps/$1.yaml
          else
            echo "save_map <map name>"
        fi