Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting for robot_description to be published on robot_description topic #15

Open
Leesanhang opened this issue May 27, 2024 · 191 comments
Open

Comments

@Leesanhang
Copy link

Leesanhang commented May 27, 2024

Hi there, I am currently doing my project on ROS2. Here are some of the hardware I am using:
Mecanum base, esp32-WROOM-32 microcontroller, Cytron MDD10A (Generic 1) motor drivers, A2M8 RPLidar, and a raspberry Pi 4B as the main computer.

I have followed the steps in this page exactly up until the "test_acc" part. One small issue that I did encounter was "test_sensors" part. The values are not changing even when I tilt my robot and so on. (But i guess its fine since the Gyro isn't that important for my project).

The main issue that I've been facing for the past 2 weeks was this:
when I run:
ros2 launch linorobot2_bringup bringup.launch.py
or
ros2 launch linorobot2_bringup bringup.launch.py base_serial_port:=/dev/ttyUSB0 lidar_serial_port:=/dev/ttyUSB1 micro_ros_baudrate:=921600

it gives me this in the terminal:
WhatsApp Image 2024-05-22 at 15 35 47_3e9edf6d

it just waits infinitely for the robot_description to be published on the robot_description topic.

If it helps, this is my urdf file for my robot:

<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:property name="base_length" value="0.49" />
  <xacro:property name="base_width" value="0.39" />
  <xacro:property name="base_height" value="0.06" />
  
  <xacro:property name="wheel_radius" value="0.0723" />
  <xacro:property name="wheel_width" value="0.05" />

  <xacro:property name="laser_pose">
    <origin xyz="-0.0475 0 0.125" rpy="0 0 0"/>
  </xacro:property>
  
  <material name="grey">
        <color rgba="0.5 0.5 0.5 1" />
    </material>

    <material name="blue">
        <color rgba="0 0 0.5 1" />
    </material>
    
    <material name="pink">
        <color rgba="1 0.75 0.8 1" />
    </material>
    
    <!-- base_footprint (projection of base_link on the ground) -->

    <link name="base_footprint"/>
    
    <joint name="base_joint" type="fixed">
        <parent link="base_footprint"/>
        <child link="base_link"/>
        <origin xyz="0 0 0.2" rpy="0 0 0"/>
    </joint>
    
    <!-- base_link and base_scan (required for Nav2) -->

    <link name="base_link">
        <visual>
            <geometry>
                <box size="${base_length} ${base_width} ${base_height}" />
            </geometry>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <material name="blue" />
        </visual>
    </link>
    
    <joint name="base_scan_joint" type="fixed">
        <parent link="base_link"/>
        <child link="base_scan"/>
        <origin xyz="0 0 0.06" rpy="0 0 0"/>
    </joint>
    
    <link name="base_scan">
        <visual>
            <geometry>
                <cylinder radius="0.0375" length="0.04"/>
            </geometry>
            <origin xyz="0 0 0.04" rpy="0 0 0" />
            <material name="pink" />
        </visual>
    </link>
    
    <!-- Wheels (4 mecanum wheels) -->
    
    <joint name="base_left_back_wheel_joint" type="continuous">
        <parent link="base_link"/>
        <child link="left_back_wheel"/>
        <origin xyz="-0.22 0.225 -0.01" rpy="0 0 0"/>
        <axis xyz="0 1 0"/>
    </joint>

    <link name="left_back_wheel">
        <visual>
            <geometry>
                <cylinder radius="${wheel_radius}" length="${wheel_width}"/>
            </geometry>
            <origin xyz="0 0 0" rpy="1.57 0 0" />
            <material name="grey" />
        </visual>
    </link>
    
    <joint name="base_right_back_wheel_joint" type="continuous">
        <parent link="base_link"/>
        <child link="right_back_wheel"/>
        <origin xyz="-0.22 -0.225 -0.01" rpy="0 0 0"/>
        <axis xyz="0 1 0"/>
    </joint>

    <link name="right_back_wheel">
        <visual>
            <geometry>
                <cylinder radius="0.05" length="0.0723"/>
            </geometry>
            <origin xyz="0 0 0" rpy="1.57 0 0" />
            <material name="grey" />
        </visual>
    </link>
    
    <joint name="base_left_front_wheel_joint" type="continuous">
        <parent link="base_link"/>
        <child link="left_front_wheel"/>
        <origin xyz="0.22 0.225 -0.01" rpy="0 0 0"/>
        <axis xyz="0 1 0"/>
    </joint>

    <link name="left_front_wheel">
        <visual>
            <geometry>
                <cylinder radius="0.05" length="0.0723"/>
            </geometry>
            <origin xyz="0 0 0" rpy="1.57 0 0" />
            <material name="grey" />
        </visual>
    </link>
    
    <joint name="base_right_front_wheel_joint" type="continuous">
        <parent link="base_link"/>
        <child link="right_front_wheel"/>
        <origin xyz="0.22 -0.225 -0.01" rpy="0 0 0"/>
        <axis xyz="0 1 0"/>
    </joint>

    <link name="right_front_wheel">
        <visual>
            <geometry>
                <cylinder radius="0.05" length="0.0723"/>
            </geometry>
            <origin xyz="0 0 0" rpy="1.57 0 0" />
            <material name="grey" />
        </visual>
    </link>
    
    
</robot>

Any help to solve this issue is much appreciated, Thank youu!

@Leesanhang
Copy link
Author

Leesanhang commented May 27, 2024

Update: When I run:
ros2 launch linorobot2_bringup bringup.launch.py base_serial_port:=/dev/ttyUSB0 lidar_serial_port:=/dev/ttyUSB1 micro_ros_baudrate:=921600
command, only /parameter_events and /rosout topics show up when I run ros2 topic list.

I also did try to unplug and plug my esp32, and it only publishes up until "running" instead of "logger setup".

@hippo5329
Copy link
Owner

  1. Both esp32 and lidar use the same device names as /dev/ttyUSBx, 0 or 1. It is very easy to mixed up. Disconnect the lidar first. Only the esp32 is connected.
  2. Please run the micro-ROS agent connection test. https://github.com/hippo5329/linorobot2_hardware/wiki#esp32-with-micro-ros-serial-transport
  3. imu is not enabled by default in esp32_config.h. Which imu do you use? You will need to uncomment the line, eg, #define USE_MPU6050_IMU. You should see the i2cdetect. https://github.com/hippo5329/linorobot2_hardware/wiki#i2cdetect-debug-message . And the imu reading in test_sensors should change as you move. You should also see the /imu/data topic changing in step 2.
  4. gyro is important. Ekf filter will fuse the wheel odometry and yaw from imu.
  5. You should install the linorobot2 with "a2", which is for rplidar a2. eg. bash install_linorobot2.bash 2wd a2
  6. You will need the by-path names to specify which serial port is esp32 and lidar. https://github.com/hippo5329/linorobot2_hardware/wiki#esp32-with-serial-transport-and-ld19-lidar
  7. In the bring up messages, you should see many messages from "micro ros agent", "joint state publisher", "robot state publisher" and rplidar. In your photo, the micro-ros agent is not connected yet and the lidar did not start.

@hippo5329
Copy link
Owner

I added more details on micro-ros agent connection test and bringup launch. Please check the wiki.

@Leesanhang
Copy link
Author

Leesanhang commented May 29, 2024

Hi again, I am quite new to ROS so there are quite a few things that I am still unfamiliar with. For the past day, I have been trying to do step 2 and this is the output I am getting.

WhatsApp Image 2024-05-22 at 15 35 47_3e9edf6d

The open device errors are due to me unplugging the esp and plugging it back in.

I didn't face this problem before I started the changes at https://github.com/hippo5329/linorobot2_hardware/wiki#custom-configuration-file---recommended
If it helps, after running
pio run -e esp32 -t upload
The blue LED on the esp blinks 3 times.

I am quite unsure on how to proceed now.

@hippo5329
Copy link
Owner

No worries. I am new to ROS2 and I keep learning, too.
Please follow my suggested work flow. In another directory, clone my fork again. Follow this,
https://github.com/hippo5329/linorobot2_hardware/wiki#install-firmware-source
Do not change the source. Build, upload and test connection.
https://github.com/hippo5329/linorobot2_hardware/wiki#esp32-with-micro-ros-serial-transport

@hippo5329
Copy link
Owner

The access mode of ttyUSB0 might be wrong. You might miss the step,

Install PlatformIO udev rules.

curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
sudo service udev restart
sudo usermod -a -G dialout $USER
sudo usermod -a -G plugdev $USER

Then unplug and plug esp32.

$ ls /dev/ttyU* -l
crw-rw-rw- 1 root dialout 188, 0 May 29 15:22 /dev/ttyUSB0

@Leesanhang
Copy link
Author

Leesanhang commented May 30, 2024

So, I've tried doing everything from scratch again and I've passed the connection test here: https://github.com/hippo5329/linorobot2_hardware/wiki#esp32-with-micro-ros-serial-transport

And now, I am currently doing step 3 in your earlier comment: https://github.com/hippo5329/linorobot2_hardware/issues/15#issuecomment-2133987557

This is the output I am getting:
WhatsApp Image 2024-05-31 at 00 23 16_267f648e
(I've tried changing the baudrate because I've encountered similar problems in earlier projects related to Arduino.)

Is there any way I can complete this project without implementing the IMU?

Edit: I tried to skip to https://github.com/hippo5329/linorobot2_hardware/wiki#test-the-motors-and-encoders and the same thing is happening. Random characters are appearing. I actually had no issues with particular part running earlier.

Edit 2: Now that I'm doing the connection test again after doing the steps from https://github.com/hippo5329/linorobot2_hardware/wiki#custom-configuration-file---recommended , the same issue from earlier is happening.
image

@hippo5329
Copy link
Owner

Good. Please tell me which IMU you use. And show me the configuration of your IMU. The micro-ROS middle ware is running on the serial. So you will see random chars because the communication is binary, not ascii code. Keep the baud rate at 921600. You will need to press reset button on the esp32 to see the messages right after boot.

@hippo5329
Copy link
Owner

You should run the test_sensors. There is no micro-ros protocol in test_sensors. Press reset button on the esp32 to see the boot message.

@Leesanhang
Copy link
Author

I am using an MPU6050. My IMU is connected to an Arduino 5V and GND for the time being, and the SDA and SCL are connected to pins 21 and 22 of my ESP respectively.

@hippo5329
Copy link
Owner

Why Arduino? Connect 5V to 5V on esp32 module.

@hippo5329
Copy link
Owner

Connect 5V of MPU6050 to 5V on esp32. Connect gnd of MPU6050 to gnd on esp32.

@Leesanhang
Copy link
Author

Sorry but I dont actually have a 5V pin on my ESP. I am using this dev board: https://i0.wp.com/circuits4you.com/wp-content/uploads/2018/12/ESP32-Pinout.jpg?resize=604%2C373&ssl=1

@hippo5329
Copy link
Owner

Please check with a multimeter the Vin of esp32. If you see 5-4.5V, then use the Vin. Otherwise use 3.3V output of esp32.

@hippo5329
Copy link
Owner

I check the same module. The Vin is 4.6V. You can use Vin to 5v of MPU6050.

@hippo5329
Copy link
Owner

There is a LDO 3.3V on the GY521. The MPU6050 chip uses 3.3V. It is fine.

@Leesanhang
Copy link
Author

I've connected all the relevant pins as you instructed in previous comments. 5V and GND of IMU to Vin and GND of ESP.
Running "test_sensors" gives me the same output - random characters.

@hippo5329
Copy link
Owner

pio device monitor -e esp32 -b 921600

@Leesanhang
Copy link
Author

I've tried defining the baudrate for earlier comments too. Same, using "-b 921600" but the outputs are the same. Same case for this "test_sensors" command.

@Leesanhang
Copy link
Author

Leesanhang commented May 30, 2024

I'm really not sure why is it outputting these characters. I had no such issues earlier, even when running "test_motors", "test_sensors", and "test_acc".
Now that I cloned a new ws and started from scratch, these issues are showing up.

@hippo5329
Copy link
Owner

cd test_motors
pio run -e esp32 -t upload
pio device monitor -e esp32
Test with a bare esp32 like yours. I will add a mpu6050 later.

ACC 0.00 0.00 0.00 GYR 0.00 0.00 0.00 MAG 0.00 0.00 0.00
BAT 0.45V RANGE 0.00m
��␀�␀���␀�␀␀␀�␀�����␀��␀␀␀␀␀␀␀␀␀␀␀␀␀�␀␀␀�␀␀␀␀␀␀␀␀�␀␀␀␀␀␀␀␀�␀���␀��␀��␀␀�␀��␀␀�␀␀␀��␀�␀��␀�␀␀␀␀��␀␀␀␀␀�␀␀���␀�������␀�␀␀���␀�␀␀����␀␀����␀��␀����␀�␀����␀�␀␀�␀␀␀�������␀��␀�␀␀␀␀��␀␀�␀␀␀␀␀�␀�␀��␀���␀␀����␀␀��␀��␀��␀������␀␀�␀␀��␀��␀��␀␀����␀␀��␀��␀�␀����␀�␀��␀␀�␀�␀����␀��␀␀��␀���␀��␀��␀��␀�␀�␀␀␀␀␀␀�␀␀␀�␀��␀���␀␀�����␀��␀�␀␀␀␀���␀���␀���␀␀�␀�␀�␀���������␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀�␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀␀␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀�␀��␀�␀␀���␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀␀��␀␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀���␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀��␀␀�␀�������␀␀���␀�␀�␀␀␀��␀␀��␀�␀�␀␀␀�␀�␀������␀�����␀␀␀␀��␀��␀��␀�␀�␀␀��␀␀�␀␀������␀�␀␀�␀�␀␀␀␀��␀␀␀␀�␀␀�␀␀�␀␀␀␀�␀␀␀␀␀�␀␀����␀�␀��␀�␀�␀␀�␀␀␀�␀␀�␀��␀␀�␀␀������␀�␀␀�␀�␀␀␀␀�␀�␀␀␀␀␀��␀␀␀␀␀␀␀␀␀␀�␀␀����␀�␀��␀�␀�␀␀�␀␀�␀␀␀�␀␀�␀��␀␀�␀␀������␀�␀␀�␀�␀␀␀␀�␀�␀␀␀␀␀␀␀␀␀␀�␀␀␀␀␀␀�␀␀����␀�␀��␀�␀�␀␀␀�␀␀␀␀␀��␀␀�␀��␀�␀��␀��␀␀��␀�␀␀␀␀␀�␀�␀␀␀␀␀␀␀␀␀���␀␀␀�␀␀��␀␀�␀ 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

ACC 0.00 0.00 0.00 GYR 0.00 0.00 0.00 MAG 0.00 0.00 0.00
BAT 1.15V RANGE 0.00m
ACC 0.00 0.00 0.00 GYR 0.00 0.00 0.00 MAG 0.00 0.00 0.00
BAT 0.66V RANGE 0.00m
ACC 0.00 0.00 0.00 GYR 0.00 0.00 0.00 MAG 0.00 0.00 0.00
BAT 0.58V RANGE 0.00m
ACC 0.00 0.00 0.00 GYR 0.00 0.00 0.00 MAG 0.00 0.00 0.00
BAT 0.63V RANGE 0.00m

@hippo5329
Copy link
Owner

Remove previous libs build.
rm -rf ~/.platformio
rm -rf linorobot2_hardware/firmware/.pio
rm -rf linorobot2_hardware/test_motors/.pio
rm -rf linorobot2_hardware/test_sensors/.pio

Then build again.

@Leesanhang
Copy link
Author

Sorry but what does this error mean?
bash: /home/leesanhang/.platformio/penv/bin/pio: No such file or directory

@hippo5329
Copy link
Owner

It might be link. It is not important. Rebuild and test again.

@hippo5329
Copy link
Owner

Oh, I deleted pio. Need to reinstall platformio.

curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
python3 get-platformio.py

@Leesanhang
Copy link
Author

Yup, I just realised platformio was deleted. Got it, I reinstalled and I am trying to build now.

@hippo5329
Copy link
Owner

with mpu9250, and press reset button.

ACC 0.06 -0.04 11.17 GYR -0.07 -0.07 -0.07 MAG 0.00 0.00 0.00
BAT 4.35V RANGE 0.00m
��␀�␀���␀�␀␀␀�␀�����␀��␀␀␀␀␀␀␀␀␀␀␀␀␀�␀␀␀�␀␀␀␀␀␀␀␀�␀␀␀␀␀␀␀␀�␀���␀��␀��␀␀�␀��␀␀�␀␀␀��␀�␀��␀�␀␀␀␀��␀␀␀␀␀�␀␀���␀�������␀�␀␀���␀�␀␀����␀␀����␀��␀����␀�␀����␀�␀␀�␀␀␀�������␀��␀�␀␀␀␀��␀␀�␀␀␀␀␀�␀�␀��␀���␀␀����␀␀��␀��␀��␀������␀␀�␀␀��␀��␀��␀␀����␀␀��␀��␀�␀����␀�␀��␀␀�␀�␀����␀��␀␀��␀���␀��␀��␀��␀�␀�␀␀␀␀␀␀�␀␀␀�␀��␀���␀␀�����␀��␀�␀␀␀␀���␀���␀���␀␀�␀�␀�␀���������␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀�␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀␀␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀�␀��␀�␀␀���␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀␀��␀␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀␀�␀���␀����␀␀�␀␀�␀��␀�␀␀␀␀�␀␀␀␀��␀␀�␀�������␀␀���␀�␀�␀␀␀��␀␀��␀�␀�␀␀␀�␀�␀������␀�����␀␀␀␀��␀��␀��␀�␀�␀␀��␀␀�␀␀������␀�␀␀�␀�␀␀␀␀��␀␀␀␀�␀␀�␀␀�␀␀␀␀�␀␀␀␀␀�␀␀����␀�␀��␀�␀�␀␀�␀␀␀�␀␀�␀��␀␀�␀␀������␀�␀␀�␀�␀␀␀␀�␀�␀␀␀␀␀��␀␀␀␀␀␀␀␀␀␀�␀␀����␀�␀��␀�␀�␀␀�␀␀�␀␀␀�␀␀�␀��␀␀�␀␀������␀�␀␀�␀�␀␀␀␀�␀�␀␀␀␀␀␀␀␀␀␀�␀␀␀␀␀␀�␀␀����␀�␀��␀�␀�␀␀␀�␀␀␀␀␀��␀␀�␀��␀�␀��␀��␀␀��␀�␀␀␀␀␀�␀�␀␀␀␀␀␀␀␀␀���␀␀␀�␀␀��␀␀�␀ 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

ACC 0.60 -1.51 10.80 GYR 0.07 0.03 0.07 MAG 0.00 0.00 0.00
BAT 5.17V RANGE 0.00m
ACC 1.01 -0.85 10.66 GYR -0.11 -0.09 -0.11 MAG 0.00 0.00 0.00
BAT 0.68V RANGE 0.00m

@Leesanhang
Copy link
Author

I'm still getting this
image
when I run ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0 --baudrate 921600

@hippo5329
Copy link
Owner

Do you use ubuntu alone or are you using ubuntu inside windows?
How about test_sensors? Press reset button to see the the message.

@hippo5329
Copy link
Owner

Where do you mount the mpu6050? Have you added 2K pull up to the sda scl? You should mount the mpu6050 on your prototype board. The i2c cable should be short.

@Leesanhang
Copy link
Author

Shouldn't the MPU be mounted in the very middle of the robot? My prototype board is about right bottom of my robot.
Yes, the 2K resistors are added between the 3V3 and SCL and SDA pins.

@hippo5329
Copy link
Owner

The position of the IMU is not so important. We can adjust the IMU link later. The noise interference is more critical. I would suggest move the IMU on the prototype board.

@Leesanhang
Copy link
Author

Hi again, sorry there were no updates on my side for the IMU. For the past few days, I've been trying to solve the problem but it seems quite impossible to fix for now. I figured I continue without the IMU (for now) because my robot will always be on flat and clean surfaces.

I've decided to move on to the SLAM and navigation part. The issue now is that when I run l
ros2 launch linorobot2_navigation navigation.launch.py rviz:=true map:=/home/leesanhang/testing.yaml
the Rviz does show up but the map is just plain blank,, without the robot and laser scans too.

@hippo5329
Copy link
Owner

Have you tried move the IMU on the prototype board and use short wires to connect?

You should add a 220uF-470uF electrolytic capacitor to the VIN and GND of esp32. The small yellow cap is too small.

Have you tested the lidar on PC without esp32 pluged?
https://github.com/Slamtec/sllidar_ros2
ros2 launch sllidar_ros2 view_sllidar_a2m8_launch.py

Then, on the robot, bringup, check /scan rate, it should be 10.
ros2 topic hz /scan

run slam
https://github.com/hippo5329/linorobot2_hardware/wiki#slam
ros2 launch linorobot2_navigation slam.launch.py rviz:=true

Can you see the laser on slam rviz?
Can y

@Leesanhang
Copy link
Author

Hi again, sorry I have not given you an update. I was taking a short break.
However, I have just tried everything and tried to map the indoor environment and it went well. Probably just abit of a slow feedback time when the robot is facing dynamic obstacles.

May I also ask, is Cartographer or GMapping used to run SLAM?

@hippo5329
Copy link
Owner

Good.

"is Cartographer or GMapping used to run SLAM?", I don't know. I am new to ROS/NAV, too.

@Leesanhang
Copy link
Author

Btw, I would like to see the /tf tree and I run the command:
ros2 run tf2 tools_view_frames
but it returns the error: no executable found
Do you have any idea how to pull the transform frame tree up?

@hippo5329
Copy link
Owner

ros2 run tf2_tools view_frames

@Leesanhang
Copy link
Author

It returns the error: the following arguments are required: executable_name, argv

@hippo5329
Copy link
Owner

sudo apt-get install ros-humble-tf2-ros ros-humble-tf2-tools

@Leesanhang
Copy link
Author

It works, thank you.

@Leesanhang
Copy link
Author

I realized the localization stack uses AMCL, hence the robot can determine where it is in the map without us setting its position in "estimate pose" in RViz. May I ask if you know how to use it, or how to implement it?

@hippo5329
Copy link
Owner

http://wiki.ros.org/amcl#Parameters

~initial_pose_x (double, default: 0.0 meters)
Initial pose mean (x), used to initialize filter with Gaussian distribution.

~initial_pose_y (double, default: 0.0 meters)
Initial pose mean (y), used to initialize filter with Gaussian distribution.

The initial pose is required. The initial pose does not need to be very accurate.

@Leesanhang
Copy link
Author

So, actually, AMCL does not just auto-detect where the robot is when RViz is launched?

@hippo5329
Copy link
Owner

No. In case there are multiple rooms, there is no way to determine which room the robot is in.

@Leesanhang
Copy link
Author

Im now facing a problem where it says "timed out waiting for transform from base_link to map to become available, tf error: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist.

This occurs quite frequently and Im not sure why, but now the navigation of my robot is very slow. As in the processing takes quite a long time.

@hippo5329
Copy link
Owner

From the other cases, I learned that rplidar sensors require higher voltage power, just like raspi boards. I would suggest 5.25V power and short thick USB charging cables. You may use a step down from battery. You should check the voltage on the rplidar adapter. It should be higher than 4.9V.

A2M8 has higher sampling rate. It means there are more laser scan data to process. You may check CPU load with top or htop. You might consider rpi5 or mini pc N95/N100/N200 as robot computer.

You may also try discovery server and run navigation/rviz on a remote PC.
https://github.com/hippo5329/linorobot2_hardware/wiki#use-ros2-with-fast-dds-discovery-server---optional

That way, run only bringup on robot computer and run navigation/slam/rviz on a remote PC.

@Leesanhang
Copy link
Author

Okay, I will try that out. one more thing, When I try to use the waypoint following to navigate through multiple goals, the robot doesnt move as well. May i know if that can be fixed?

@Leesanhang
Copy link
Author

I am currently testing the robot in the map but the feedback keeps aborting although the path is very big. May I know how I can fix that?

@hippo5329
Copy link
Owner

Please describe the moving issue.

  1. Have you enabled the IMU?

  2. Have you adjust the velocity_smoother parameters for Y and reduced accelerations?

  3. The left/right wheels distance should be adjusted for Mecanum/4WD, which is different from differential drive. It might be the distance front-left wheel to rear-right wheel. You may try to find the setting where the error between laser scan and map is minimized.

@hippo5329
Copy link
Owner

#define WHEEL_DIAMETER 0.0560 // wheel's diameter in meters

  1. Have you checked the wheel speed with a digital tachometer in test_motors?

@Leesanhang
Copy link
Author

Hi, so I've been trying your suggestions.

  1. Unfortunately, the IMU is still not working and i think i burnt it so it'll be a few days before i get a new one.
  2. I've adjusted it like you instructed. X=Y
  3. Im not sure if i understand. can you clarify?
  4. Unfortunately I dont have a tachometer. What else do you suggest i can do to check? My wheel diameter is 10cm so i defined it to be 0.05. This is in URDF right?

@hippo5329
Copy link
Owner

  1. Did you place the IMU on prototype board? IMU is important.

  2. Try lower the accel to 1/2 the values.

  3. I pasted the wrong line. in esp32_config.h,
    #define LR_WHEELS_DISTANCE 0.224

For Mecanum drive, the LR_WHEELS_DISTANCE will be larger than the front-left wheel to front-right wheel eg 20. It might be front-left wheel to rear-right wheel, eg, if the wheels position is square, 20 * 1.414 . You may have to adjust.

  1. You may try cellphone apps, tacho meter strobe. I have never tried.

@Leesanhang
Copy link
Author

The distance (from centre of wheels) from left to right is 49 while centre of front to back is 46. Can you advice me on how to define the LR_WHEELS_DISTANCE ?

@hippo5329
Copy link
Owner

Between 0.49-0.67. You may try 0.6. Check the error when robot turn and try other values.

@hippo5329
Copy link
Owner

IMG_20240618_073101.jpg

@hippo5329
Copy link
Owner

You used some expensive lidar, motors, encoders and motor drivers. They won't give you better result for the first time robot. It will be easier if you start over with a small, light-weight and cheap robot as I suggested "the first robot for beginner" in my wiki. Lesson learned from small robot will help you with larger, more powerful robots. It will only waste your time (and mine), if you skip the simple step, jump into your dream robot and want to success in the first try. NO WAY. You need to learn the basic.

Your wiring is a mess.

You need to use thick short wires to connect the battery to motor controllers. Remove all unnecessary connectors. Use soldering if possible.

Add large 220uF-470uF electrolytic capacitors to your powers near the loads.

Add a battery voltage ADC sensor. It is important to diagnosis power issue.

Start with 12V power. Use only one 12V battery. Change the MAX_RPM to 1/2 the value. It will move slower and this will be fine for the first time robot.

Put IMU on your prototype board.

@Leesanhang
Copy link
Author

Leesanhang commented Jun 18, 2024

Thank you for your suggestions. I guess I was too ambitious from the start. I will take your advice and try to start small first.
Actually, on a side note, may I get your full name? I would like to include you in the acknowledgement part of my report.

@hippo5329
Copy link
Owner

Good. The starter robot is a learning tool.

Thomas Chou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants