jetson nano ubuntu 18.04 ros melodic python3

configuration for jetson nano ubuntu 18.04 ros melodic python3 for nvidia-jetpack 4.5.1 for tensorflow 2.5.0 cuda gpu

# first i follow this page but it was some what strange the remove and reinstal
https://dhanoopbhaskar.com/blog/2020-05-07-working-with-python-3-in-ros-kinetic-or-melodic/

# then I follow this page
https://medium.com/@beta_b0t/how-to-setup-ros-with-python-3-44a69ca36674
https://github.com/betab0t/ros_python3_issues

# the cv_bridge problem i used this page

Compiling ROS cv_bridge with Python 3

# what i have done was more or less this

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

#
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

#sudo apt-get install python-catkin-tools python3-dev python3-numpy
sudo apt-get install python-catkin-tools python3-dev python3-catkin-pkg-modules python3-numpy python3-yaml ros-melodic-cv-bridge

mkdir -p ~/catkin_build_ws/src && cd ~/catkin_build_ws
catkin config -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so
catkin config –install

cd src
#git clone -b melodic https://github.com/ros-perception/vision_opencv.git
git clone -b noetic https://github.com/ros-perception/vision_opencv.git

#apt-cache show ros-melodic-cv-bridge | grep Version
#Version: 1.13.0-0bionic.20210506.020113

cd vision_opencv/

#git checkout 1.13.0

cd ../../

nano /home/inaciose/catkin_build_ws/src/vision_opencv/cv_bridge/CMakeLists.txt

# line 16 (or near)
# find_package(Boost REQUIRED python37)

to

# find_package(Boost REQUIRED python3)

catkin build cv_bridge

source ~/catkin_build_ws/install/setup.bash –extend

# other links
https://www.programmersought.com/article/93196809260/
https://stackoverflow.com/questions/54094876/ros-melodic-installation-with-python-3-only-and-without-messing-up-system-librar