Ekumen-OS / andino

Open-source diff drive robot ROS 2 compatible
188 stars 47 forks source link

Help on first steps with real robot #274

Open thanhtruongphan opened 4 weeks ago

thanhtruongphan commented 4 weeks ago

I've set up all firmware both on SBC and dev-PC, 👋

I could run gazebo with teleop-twist-keyboard successfully,

but the Real-robot doesn't work... I don't know how to do...

Can anyone help me, pls...

Thank you so much and have a nice day!! 🥹

Screenshot 2024-10-28 214557

thanhtruongphan commented 4 weeks ago

I tried with the data 'o 255 255' to serial but nothing happen...

image

and I have a question: Do I need to add any code via Arduino IDE? Or just only upload via PlatformIO via command line pio run --target upload -e nanoatmega328new

thanhtruongphan commented 3 weeks ago

oh, oh, maybe Ubuntu on VMvirtualbox machine can connect properly with SBC,

now I can use teleop_twist_keyboard to control two motors.

but, maybe I have some problem, when I run command ros2 launch andino_bringup andino_robot.launch.py:

image

more detail:

[INFO] [launch]: All log files can be found below /home/truongpt/.ros/log/2024-11-02-11-05-19-391756-truongpt-sbc-96943
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [97024]
[robot_state_publisher-1] [WARN] [1730520322.065477803] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[robot_state_publisher-1] [INFO] [1730520322.071813321] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1730520322.074996867] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1730520322.075066514] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1730520322.075105976] [robot_state_publisher]: got segment caster_base_link
[robot_state_publisher-1] [INFO] [1730520322.075141049] [robot_state_publisher]: got segment caster_rotation_link
[robot_state_publisher-1] [INFO] [1730520322.075173660] [robot_state_publisher]: got segment caster_wheel_link
[robot_state_publisher-1] [INFO] [1730520322.075205585] [robot_state_publisher]: got segment left_motor
[robot_state_publisher-1] [INFO] [1730520322.075237066] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1730520322.075268898] [robot_state_publisher]: got segment right_motor
[robot_state_publisher-1] [INFO] [1730520322.075300379] [robot_state_publisher]: got segment right_wheel
[robot_state_publisher-1] [INFO] [1730520322.075331786] [robot_state_publisher]: got segment rplidar_laser_link
[robot_state_publisher-1] [INFO] [1730520322.075363415] [robot_state_publisher]: got segment second_base_link
[INFO] [v4l2_camera_node-2]: process started with pid [97086]
[INFO] [rplidar_composition-3]: process started with pid [97105]
[v4l2_camera_node-2] [INFO] [1730520325.915706520] [v4l2_camera]: Driver: bm2835 mmal
[v4l2_camera_node-2] [INFO] [1730520325.916024772] [v4l2_camera]: Version: 331683
[v4l2_camera_node-2] [INFO] [1730520325.916058753] [v4l2_camera]: Device: mmal service 16.1
[v4l2_camera_node-2] [INFO] [1730520325.916080919] [v4l2_camera]: Location: platform:bcm2835-v4l2-0
[v4l2_camera_node-2] [INFO] [1730520325.916101271] [v4l2_camera]: Capabilities:
[v4l2_camera_node-2] [INFO] [1730520325.916121659] [v4l2_camera]:   Read/write: YES
[v4l2_camera_node-2] [INFO] [1730520325.916141955] [v4l2_camera]:   Streaming: YES
[v4l2_camera_node-2] [INFO] [1730520325.916184195] [v4l2_camera]: Current pixel format: YUYV @ 640x480
[v4l2_camera_node-2] [INFO] [1730520325.917353745] [v4l2_camera]: Available pixel formats: 
[v4l2_camera_node-2] [INFO] [1730520325.917410170] [v4l2_camera]:   YU12 - Planar YUV 4:2:0
[v4l2_camera_node-2] [INFO] [1730520325.917433188] [v4l2_camera]:   YUYV - YUYV 4:2:2
[v4l2_camera_node-2] [INFO] [1730520325.917452965] [v4l2_camera]:   RGB3 - 24-bit RGB 8-8-8
[v4l2_camera_node-2] [INFO] [1730520325.917472632] [v4l2_camera]:   JPEG - JFIF JPEG
[v4l2_camera_node-2] [INFO] [1730520325.917491909] [v4l2_camera]:   H264 - H.264
[v4l2_camera_node-2] [INFO] [1730520325.917511131] [v4l2_camera]:   MJPG - Motion-JPEG
[v4l2_camera_node-2] [INFO] [1730520325.917530279] [v4l2_camera]:   YVYU - YVYU 4:2:2
[v4l2_camera_node-2] [INFO] [1730520325.917549315] [v4l2_camera]:   VYUY - VYUY 4:2:2
[v4l2_camera_node-2] [INFO] [1730520325.917568648] [v4l2_camera]:   UYVY - UYVY 4:2:2
[v4l2_camera_node-2] [INFO] [1730520325.917587481] [v4l2_camera]:   NV12 - Y/CbCr 4:2:0
[v4l2_camera_node-2] [INFO] [1730520325.917606629] [v4l2_camera]:   BGR3 - 24-bit BGR 8-8-8
[v4l2_camera_node-2] [INFO] [1730520325.917625591] [v4l2_camera]:   YV12 - Planar YVU 4:2:0
[v4l2_camera_node-2] [INFO] [1730520325.917644887] [v4l2_camera]:   NV21 - Y/CrCb 4:2:0
[v4l2_camera_node-2] [INFO] [1730520325.917664294] [v4l2_camera]:   RX24 - 32-bit XBGR 8-8-8-8
[v4l2_camera_node-2] [INFO] [1730520325.917684109] [v4l2_camera]: Available controls: 
[v4l2_camera_node-2] [INFO] [1730520325.917723200] [v4l2_camera]:   Brightness (1) = 50
[v4l2_camera_node-2] [INFO] [1730520325.917758366] [v4l2_camera]:   Contrast (1) = 0
[v4l2_camera_node-2] [INFO] [1730520325.917790606] [v4l2_camera]:   Saturation (1) = 0
[v4l2_camera_node-2] [INFO] [1730520325.917822847] [v4l2_camera]:   Red Balance (1) = 1000
[v4l2_camera_node-2] [INFO] [1730520325.917853290] [v4l2_camera]:   Blue Balance (1) = 1000
[v4l2_camera_node-2] [INFO] [1730520325.917882790] [v4l2_camera]:   Horizontal Flip (2) = 0
[v4l2_camera_node-2] [INFO] [1730520325.917912104] [v4l2_camera]:   Vertical Flip (2) = 0
[v4l2_camera_node-2] [INFO] [1730520325.917942326] [v4l2_camera]:   Power Line Frequency (3) = 1
[v4l2_camera_node-2] [INFO] [1730520325.917972473] [v4l2_camera]:   Sharpness (1) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918002287] [v4l2_camera]:   Color Effects (3) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918031935] [v4l2_camera]:   Rotate (1) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918061416] [v4l2_camera]:   Color Effects, CbCr (1) = 32896
[v4l2_camera_node-2] [ERROR] [1730520325.918107896] [v4l2_camera]: Failed getting value for control 10027009: Permission denied (13); returning 0!
[v4l2_camera_node-2] [INFO] [1730520325.918183043] [v4l2_camera]:   Codec Controls (6) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918218950] [v4l2_camera]:   Video Bitrate Mode (3) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918250671] [v4l2_camera]:   Video Bitrate (1) = 10000000
[v4l2_camera_node-2] [INFO] [1730520325.918281578] [v4l2_camera]:   Repeat Sequence Header (2) = 0
[v4l2_camera_node-2] [ERROR] [1730520325.918313059] [v4l2_camera]: Failed getting value for control 10029541: Permission denied (13); returning 0!
[v4l2_camera_node-2] [INFO] [1730520325.918335299] [v4l2_camera]:   Force Key Frame (4) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918364613] [v4l2_camera]:   H264 Minimum QP Value (1) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918394872] [v4l2_camera]:   H264 Maximum QP Value (1) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918424445] [v4l2_camera]:   H264 I-Frame Period (1) = 60
[v4l2_camera_node-2] [INFO] [1730520325.918454889] [v4l2_camera]:   H264 Level (3) = 11
[v4l2_camera_node-2] [INFO] [1730520325.918484203] [v4l2_camera]:   H264 Profile (3) = 4
[v4l2_camera_node-2] [ERROR] [1730520325.918514740] [v4l2_camera]: Failed getting value for control 10092545: Permission denied (13); returning 0!
[v4l2_camera_node-2] [INFO] [1730520325.918535684] [v4l2_camera]:   Camera Controls (6) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918564776] [v4l2_camera]:   Auto Exposure (3) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918595294] [v4l2_camera]:   Exposure Time, Absolute (1) = 1000
[v4l2_camera_node-2] [INFO] [1730520325.918625812] [v4l2_camera]:   Exposure, Dynamic Framerate (2) = 0
[v4l2_camera_node-2] [INFO] [1730520325.918656811] [v4l2_camera]:   Auto Exposure, Bias (9) = 12
[v4l2_camera_node-2] [INFO] [1730520325.918686570] [v4l2_camera]:   White Balance, Auto & Preset (3) = 1
[v4l2_camera_node-2] [INFO] [1730520325.918715976] [v4l2_camera]:   Image Stabilization (2) = 0
[v4l2_camera_node-2] [INFO] [1730520325.922449233] [v4l2_camera]:   ISO Sensitivity (9) = 0
[v4l2_camera_node-2] [INFO] [1730520325.922537157] [v4l2_camera]:   ISO Sensitivity, Auto (3) = 1
[v4l2_camera_node-2] [INFO] [1730520325.922574545] [v4l2_camera]:   Exposure, Metering Mode (3) = 0
[v4l2_camera_node-2] [INFO] [1730520325.922610545] [v4l2_camera]:   Scene Mode (3) = 0
[v4l2_camera_node-2] [ERROR] [1730520325.922649173] [v4l2_camera]: Failed getting value for control 10289153: Permission denied (13); returning 0!
[v4l2_camera_node-2] [INFO] [1730520325.922675062] [v4l2_camera]:   JPEG Compression Controls (6) = 0
[v4l2_camera_node-2] [INFO] [1730520325.922707135] [v4l2_camera]:   Compression Quality (1) = 30
[v4l2_camera_node-2] [WARN] [1730520325.927204802] [v4l2_camera_node]: Control type not currently supported: 6, for control: Codec Controls
[v4l2_camera_node-2] [WARN] [1730520325.928066803] [v4l2_camera_node]: Control type not currently supported: 4, for control: Force Key Frame
[v4l2_camera_node-2] [WARN] [1730520325.928623588] [v4l2_camera_node]: Control type not currently supported: 6, for control: Camera Controls
[v4l2_camera_node-2] [WARN] [1730520325.929047116] [v4l2_camera_node]: Control type not currently supported: 9, for control: Auto Exposure, Bias
[v4l2_camera_node-2] [WARN] [1730520325.929344351] [v4l2_camera_node]: Control type not currently supported: 9, for control: ISO Sensitivity
[v4l2_camera_node-2] [WARN] [1730520325.929761638] [v4l2_camera_node]: Control type not currently supported: 6, for control: JPEG Compression Controls
[v4l2_camera_node-2] [INFO] [1730520325.930008948] [v4l2_camera_node]: camera calibration URL: file:///home/truongpt/ws/install/andino_bringup/share/andino_bringup/config/raspicam.yaml
[v4l2_camera_node-2] [WARN] [1730520325.940628174] [v4l2_camera_node]: [mmal_service_16.1] does not match narrow_stereo in file /home/truongpt/ws/install/andino_bringup/share/andino_bringup/config/raspicam.yaml
[v4l2_camera_node-2] [INFO] [1730520325.943830424] [v4l2_camera]: Starting camera
[v4l2_camera_node-2] [ERROR] [1730520325.944354672] [v4l2_camera]: Buffer failure on capture start: Device or resource busy (16)
[rplidar_composition-3] [INFO] [1730520327.068995447] [rplidar_node]: RPLidar running on ROS2 package rplidar_ros. RPLIDAR SDK Version:2.0.0
[rplidar_composition-3] [INFO] [1730520327.134267440] [rplidar_node]: RPLidar S/N: B296ED93C0EA98C6C2E29EF5404C4061
[rplidar_composition-3] [INFO] [1730520327.134446362] [rplidar_node]: Firmware Ver: 1.29
[rplidar_composition-3] [INFO] [1730520327.134490232] [rplidar_node]: Hardware Rev: 7
[rplidar_composition-3] [INFO] [1730520327.185997285] [rplidar_node]: RPLidar health status : 0
[rplidar_composition-3] [INFO] [1730520327.186370926] [rplidar_node]: RPLidar health status : OK.
[rplidar_composition-3] [INFO] [1730520327.186447165] [rplidar_node]: Start
[rplidar_composition-3] [INFO] [1730520328.638723404] [rplidar_node]: current scan mode: Sensitivity, sample rate: 8 Khz, max_distance: 12.0 m, scan frequency:10.0 Hz, 
[INFO] [ros2_control_node-4]: process started with pid [97226]
[INFO] [spawner-5]: process started with pid [97228]
[ros2_control_node-4] [WARN] [1730520331.693177195] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use '~/robot_description' topic from 'robot_state_publisher' instead.
[ros2_control_node-4] [INFO] [1730520331.703916586] [resource_manager]: Loading hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1730520331.724963561] [resource_manager]: Initialize hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1730520331.740330820] [DiffDriveAndino]: On init...
[ros2_control_node-4] [INFO] [1730520331.747156680] [DiffDriveAndino]: Finished On init.
[ros2_control_node-4] [INFO] [1730520331.756812445] [resource_manager]: Successful initialization of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1730520331.757391136] [resource_manager]: 'configure' hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1730520331.766788592] [DiffDriveAndino]: On configure...
[ros2_control_node-4] [INFO] [1730520331.793089719] [DiffDriveAndino]: Finished Configuration
[ros2_control_node-4] [INFO] [1730520331.793236197] [resource_manager]: Successful 'configure' of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1730520331.793284085] [resource_manager]: 'activate' hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1730520331.793311029] [DiffDriveAndino]: On activate...
[ros2_control_node-4] [INFO] [1730520331.793332658] [DiffDriveAndino]: Finished Activation
[ros2_control_node-4] [INFO] [1730520331.793359750] [resource_manager]: Successful 'activate' of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1730520331.866484564] [controller_manager]: update rate is 50 Hz
[ros2_control_node-4] [WARN] [1730520331.871475369] [controller_manager]: No real-time kernel detected on this system. See [https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html] for details on how to enable realtime scheduling.
[ros2_control_node-4] Response to e timed out.
[ros2_control_node-4] [INFO] [1730520333.935636652] [controller_manager]: Loading controller 'joint_state_broadcaster'
[spawner-5] [INFO] [1730520334.265061654] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[ros2_control_node-4] [INFO] [1730520334.276778525] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ros2_control_node-4] [INFO] [1730520334.277208757] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[spawner-5] [INFO] [1730520334.386046469] [spawner_joint_state_broadcaster]: Configured and activated joint_state_broadcaster
[INFO] [spawner-5]: process has finished cleanly [pid 97228]
[INFO] [spawner-6]: process started with pid [97314]
[spawner-6] [INFO] [1730520337.325429674] [spawner_diff_controller]: waiting for service /controller_manager/list_controllers to become available...
[ros2_control_node-4] [INFO] [1730520338.356542758] [controller_manager]: Loading controller 'diff_controller'
[spawner-6] [INFO] [1730520338.641385975] [spawner_diff_controller]: Loaded diff_controller
[ros2_control_node-4] [INFO] [1730520338.662279010] [controller_manager]: Configuring controller 'diff_controller'
[spawner-6] [INFO] [1730520338.789621437] [spawner_diff_controller]: Configured and activated diff_controller
[INFO] [spawner-6]: process has finished cleanly [pid 97314]

and when I run command to open slam package ros2 launch andino_slam slam_toolbox_online_async.launch.py

image

and no Rviz or any GUI is show up...

@francocipollone hii... hope you have a nice trip.... do you know that problem? help me pls 🥇

thanhtruongphan commented 3 weeks ago

and when I run command line to open rviz after biringup ros2 launch andino_bringup rviz.launch.py

image

francocipollone commented 3 weeks ago

Hey there @thanhtruongphan , thanks for your interest.

Let's try to understand the context, identify the issue, and then narrow down the problem that you might be facing.

  1. If you want to use the simulation at some point, check andino_gz. That's the recommended simulation (gz_classic is outdated).

  2. Were you able to move the real robot? Assuming for the output of the andino_bringup launch it seems that everything is alright, at least no errors were shown.

  3. andino_slam's launch file by default is not launching any rivz or GUI visualization ( imagine that you can either launch that on an external laptop or directly in the SBC). You have a ros2 launch andino_slam rviz.launch.py for launching only rviz with some convenient setup when doing slam.

  4. That issue you mentioned when running "ros2 launch andino_bringup rviz.launch.py" might be related most probably to the fact that map is set as fixed frame and the map is not being published. Try changing the fixed frame to base_link and see if you actually see the robot and the wheels are rotating when you rotate the real wheels (to fully see that your set up is ok and for example encoders are correctly working)

thanhtruongphan commented 3 weeks ago

hi @francocipollone very happy and thank for your reply. and have a nice day. :1st_place_medal:

now, I have problem with work between SBC-computer and ubuntu laptop. Both is Ubuntu 22.04 and ROS2 humble like the instructions in README.md file, of course Ubuntu mate on Raspi4.

The issue is I can't use the "discovery" feature https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Development-Setup.html#try-some-examples

I tried https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#the-ros-domain-id-variable but it doesn't work.

I can't listen on SBC from Ubuntu laptop or listen on Ubuntu laptop from SBC. So, I when I run Rviz on Ubuntu laptop, it doesn't show up anything. (I installed Ubuntu dual boot with Windows11 and of course use both Ubuntu on one Wifi)

Have you ever saw that problem? I've reinstalled Ubuntu mate on my SBC and hope it work... :smiling_face_with_tear:

francocipollone commented 3 weeks ago

The issue is I can't use the "discovery" feature https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Development-Setup.html#try-some-examples

Run a "talker" node in your laptop and and listener node on your SBC and vice-versa. See if the communication goes both ways.

Verify that you are not using any ROS_LOCALHOST or ROS_DOMAIN_ID env var on both computers. Later on, if you want to isolate the robot in a particular ROS_DOMAIN_ID you can do it. However if it is your first time doing so in ROS 2 start easy.

If everything is ok and still not working you can see if your router is actually causing some issue. So try using another network: The easiest way is to use your smartphone to set up a wifi network real quick and connect laptop and sbc to that wifi network and see what happens.

thanhtruongphan commented 3 weeks ago

yeah, here is env var on mine

image

I'm reinstalling ubuntu mate on SBC, and I will test again... :jack_o_lantern:

thanhtruongphan commented 3 weeks ago

yeah, using Wifi from smartphone helped me to solve problem "talker/listener". Great~ @francocipollone

now when I run rosdep install --from-paths src -i -y -r

image

result: image

I don't care it then continue the instructions to install, and finally run the command line ros2 launch andino_bringup andino_robot.launch.py

it auto close and the error is:

image

help me, pls :1st_place_medal: -thank you-

thanhtruongphan commented 3 weeks ago

yeah... the problem has been solved by using Wifi share by smartphone.

Thank you so much~ :100:

thanhtruongphan commented 3 weeks ago

sorry, i'm new to ubuntu and ROS2.

can i ask a question?

can i use this project on Jetson nano devkit (B01)? I have a Jetson nano devkit and a research project that works with this Jetson and ROS (ROS2 in case of andino) and uses machine vision with some image processing tasks.

-thanks-

francocipollone commented 3 weeks ago

That issue that was shown in the resolved comment seems something with the camera, were you able to solve it? Do you have a camera installed?

can i use this project on Jetson nano devkit (B01)?

You definitely can, I haven't tried this there but it should be fully compatible code-wise, you might need to make some changes at some point I imagine. However if you go that path it would be great to come back and mention how your experience with Jetson nano was when using it in a Andino.

thanhtruongphan commented 3 weeks ago

HI @francocipollone,

I'm new to Jetson.

I wonder if Jetson can install ROS2-humble to do andino? Since I need to do some image processing, so maybe I need Ubuntu with JetPack to install on my Jetson nano Dev kit (B01).

It seems that the latest version for my kit, with Jetpack support is Ubuntu lower than 22.04 (I don't sure)...

so I would ask you for some advice. :smiling_face_with_tear:

-thank you-