-
Notifications
You must be signed in to change notification settings - Fork 165
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
ESP32 issues anyone? #119
Comments
Hi. I am the maintainer of esp32/pico port. I am new to ROS and robot, too. Your robot is awesome.
Cheers, |
I created pull-requests pr-mag to both linorobot/linorobot2 and linorobot/linorobot2_hardware. You may use the new "micro_ros_baudrate" param in robot bringup to set the baudrate to 921600. I had similar issue before. It was resolved at 921600 baud. I would also suggest adding a supported magnetometer sensor, such as QMC5883L. The magnetometer support is added in the pr-mag branch. It might help. It would be nice to have your comments and suggestions. Thomas |
Hi Thomas,
Thank you for reaching out. There's only so much one can do on his own, so
your help is greatly appreciated.
1. I'll check the serial connection setting. That makes sense. I have also
used ESP32_wifi to see if the serial connection was at fault, but that too
had the same results.
2. I will test the IMU using "ros2 topic echo /imu/data" and report back.
Thanks for the tip!
3. Yes, I updated the specs in the config file to match the robot's
measurements. And I updated the URDF xacro file, and made sure to finalize
it with "colcon build". In fact I played around with many values (higher
and lower) to see what would occur, but the same results.
4. Your wiki is excellent. I just found it today. I will follow your
instructions to see what results I get.
One question, if you don't mind. When you run your robot in RVIZ2, do you
see the axis for the wheels rotate as your robot moves along?
Thanks, Thomas,
Thomas
…On Sun, Apr 28, 2024 at 3:01 PM Thomas Chou ***@***.***> wrote:
Hi. I am the maintainer of esp32/pico port. I am new to ROS and robot,
too. Your robot is awesome.
1. The required micro-ros serial baudrate for esp32 is 921600 to run
the control loop at 50Hz. Would you check the control loop refresh rate
with "ros2 topic hz /imu/data" ? It should be close to 50Hz.
2. The orientation of the IMU must be correct. X forward, Y left, Z
up. Please check the ACC reading of "ros2 topic echo /imu/data". When the
robot is not moving, the reading should be close to 0,0,9.8 . When the
robot start to move forward, the accX should be positive. When the robot
stop moving forward, the accX should be negative.
3. Have you updated the robot spec in esp32_config.h?
WHEEL_DIAMETER,LR_WHEELS_DISTANCE etc. Have you updated the URDF in
ros2_ws/src/linorobot2/linorobot2_description/urdf/2wd_properties.urdf.xacro
?
4. I maintain a wiki for linorobot2. Please check
https://github.com/hippo5329/linorobot2_hardware/wiki .
Cheers,
Thomas Chou
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3ONSWJVHJSS4PNWBOSCUDY7VBOXAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGYYDENZUGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hey Thomas,
I will indeed try the baud rate you suggested.
And I'll pick up a QMC5883L. I would think you would place the
sensor well away from motors, especially mine, which have 4" copper
windings and equally large magnets!
Thanks,
Thomas
…On Sun, Apr 28, 2024 at 3:21 PM Thomas Chou ***@***.***> wrote:
I created pull-requests pr-mag to both linorobot/linorobot2 and
linorobot/linorobot2_hardware. You may use the new "micro_ros_baudrate"
param in robot bringup to set the baudrate to 921600.
I had similar issue before. It was resolved at 921600 baud. I would also
suggest adding a supported magnetometer sensor, such as QMC5883L. The
magnetometer support is added in the pr-mag branch. It might help. It would
be nice to have your comments and suggestions.
Thomas
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3ONSX3RN552W5XHPWYZM3Y7VD2XAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGYYTAMZYG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You are welcome.
|
My wheels are small. I looked into the rviz. Yes, the wheels are moving. |
Yes. Mount the magnetometer away from motors and battery as much as possible. Calibrate the magnetometer to remove hard iron bias. |
Power system and the Hz freq of control loop are the first things to check. I put low ESR cap on every power. |
The nav yaml on the linorobot2 is quite old. I updated the smoother for Mecanum robot. Check the hippo5329/linorobot2 omni branch. |
Thanks, I'll check it out!
…On Sun, Apr 28, 2024 at 6:07 PM Thomas Chou ***@***.***> wrote:
The nav yaml on the linorobot2 is quite old. I updated the smoother for
Mecanum robot. Check the hippo5329/linorobot2 omni branch.
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3ONSRIKQR3IP3N4DHYOKTY7VXI7AVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGY3TIMJRGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello Thomas,
Here's the output from my MPU6050 when not moving. Not sure whether it's behaving correctly
(linear_acceleration for Z seems odd???).
Thanks,
Thomas
***@***.***:~$ ros2 topic echo /imu/data
header:
stamp:
sec: 1714345324
nanosec: 757715000
frame_id: imu_link
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 0.0
orientation_covariance:
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
angular_velocity:
x: 0.0
y: 0.0
z: 0.0
angular_velocity_covariance:
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
linear_acceleration:
x: -0.5556445550173521
y: 0.8646020877640694
z: 11.045830550603569
linear_acceleration_covariance:
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
- 0.0
- 0.0
- 0.0
- 9.999999747378752e-06
---
…On Sun, Apr 28, 2024 at 3:01 PM Thomas Chou ***@***.***> wrote:
Hi. I am the maintainer of esp32/pico port. I am new to ROS and robot,
too. Your robot is awesome.
1. The required micro-ros serial baudrate for esp32 is 921600 to run
the control loop at 50Hz. Would you check the control loop refresh rate
with "ros2 topic hz /imu/data" ? It should be close to 50Hz.
2. The orientation of the IMU must be correct. X forward, Y left, Z
up. Please check the ACC reading of "ros2 topic echo /imu/data". When the
robot is not moving, the reading should be close to 0,0,9.8 . When the
robot start to move forward, the accX should be positive. When the robot
stop moving forward, the accX should be negative.
3. Have you updated the robot spec in esp32_config.h?
WHEEL_DIAMETER,LR_WHEELS_DISTANCE etc. Have you updated the URDF in
ros2_ws/src/linorobot2/linorobot2_description/urdf/2wd_properties.urdf.xacro
?
4. I maintain a wiki for linorobot2. Please check
https://github.com/hippo5329/linorobot2_hardware/wiki .
Cheers,
Thomas Chou
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3ONSWJVHJSS4PNWBOSCUDY7VBOXAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGYYDENZUGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
How about "ros2 topic hz /imu/data"? |
tb@tb-HP-EliteBook-Revolve-810-G1:~$ ros2 topic hz /imu/data |
MPU6050 on my robot linear_acceleration: |
Do you have 2K Ohm pull up to 3.3V on the i2c sda scl line of esp23? |
No I don't. Every schematic I've come across lately doesn't have one. |
Please add the pull up. esp32 does not have them on board. |
sda scl 2K to 3.3V output of esp32. |
2k or 2.2k are fine. |
Ok, thanks for the clarification. I'll give it a try tomorrow.
Thanks again.
…On Sun., Apr. 28, 2024, 8:55 p.m. Thomas Chou, ***@***.***> wrote:
2k or 2.2k are fine.
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3ONSVNR25Z77G3XBNEJR3Y7WLATAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRG4ZTENZSGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You may try lower the velocity and acceleration limits in velocity_smoother. https://github.com/hippo5329/linorobot2_hardware/wiki#configure-the-linorobot2 |
Thanks Thomas, I'll check it out!
…On Tue., Apr. 30, 2024, 8:49 p.m. Thomas Chou, ***@***.***> wrote:
https://github.com/hippo5329/linorobot2_hardware/wiki#test-the-robot-at-maximum-velocity-and-acceleration-with-full-load
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3ONSUF4WB62UJY5XY4XULZAA3YPAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBXG44DENZSGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
What version of ESP32 are you using? S2, S3? |
I use mostly esp32 on my robots. Because I have a lot of esp32 and I run micro-ROS wifi transport. The S3 and S2 are for testing only. S3 is better than S2. As you have pi 3B and use serial transport, if you want to buy a new micro-controller, you may consider Pico, too. I had a Mecanum drive robot using Pico and Pi 5. However, I think you may use your existing esp32.
Please let me know the test results. Cheers, |
I added another patch. Now, no need to modify the ekf as point 1 I said in previous message. Just disable mpu6050 in your configuration file.
|
2wd_properties.urdf.xacro.txt The real robot responded correctly to the keyboard commands ("I" for forward, "J" for left, etc.). I then launched RVIZ2 and added robot model, TF, and selected Global Options > Fixed Frame > Odom. As the real robot moves around on the floor, the RVIZ2 robot mimics the same movements on the grid, however the axis on the wheels don't rotate. I attached my URDF xacro file for my 2WD robot. I noticed that it's not as complete as other robot descriptions I have come across. For example, there is no joint or base footprint link. |
I checked again. The wheels do not move in RVIZ on my robot. The wheels rotate on gazebo because gazebo publishes the wheels rotation tf. Real robot does not publish joint_state updates of the wheels for the joint_state_publisher. So the robot_state_publisher does not update the rotation and the wheels won't move in RVIZ. It is possible to publish the joint_state of the wheels on real robots to see the wheels rotating in RVIZ though. |
Ok. Thanks for the update. I'll look into how I can modify the code so that joint states are published for the left and right wheels. BTW, I ordered an LD19 and I'll let you know how that goes with navigation. |
Hey @tbalatka, |
@aimethierry @tbalatka Hi, I looked into the covariance yesterday, which is important to fuse the sensors. I added parameters to fine tune the covariance. The goal is to fuse the wheel odometry and IMU at some proper "ratio". Please check the latest patches on master branch of my fork and pr-mag. I would also suggest adding the battery voltage ADC and run the test_acc ( test acceleration). Make sure you have enough space to run the test_acc on the ground. Test_acc will find the limits of the robot motion. Sometime the heavy robot is slower than expected. Then reduce the values in velocity_smoother. The battery voltage drop from surge current of motors should be checked. Please check the odometry error between the laser scan and map on rviz when the robot turns. |
@aimethierry Ubuntu 20.04 and ROS2 FOXY are both EOL. You'd better switch to 22.04 and Humble. Please post photos of your robot, control board and wiring. It is important to have 2K Ohm pull up to 3.3V on the SDA SCL lines. Most MPU6050 has onboard 3.3V LDO regulator. Add low ESR cap to the power. |
Hey @hippo5329 , I am unable to transition to ROS2 HUMBLE since my JETSON NANO does not support Ubuntu 22.04. Attached are images of my control board and wiring. |
@aimethierry Wow! What a beast. Odrive is very powerful. You don't need an esp32 / linorobot2_hardware. You should connect odrive to jetson with USB CDC. There are ROS2 drivers, such as odrive github or https://github.com/Factor-Robotics/odrive_ros2_control . At the level of cost of your robot, you should use BNO055 and connect it to jetson in UART mode or a serial USB bridge. Mount the BNO055 far away from battery, lidar and motors. There is Armbian 22.04 for jetson nano. https://www.armbian.com/jetson-nano/ . However, I wonder if the nvidia sdk works. |
Thank you for your critical feedback. I was considering using micro-ros with ESP32 as it works well. However, calibration of the IMU sensor and robot localization have challenges. Do you think BN0055 is more promising? |
I'd never use a BNO055. I see a lot of people using and recommending BNO055. To me, the good point of BNO055 is the UART interface. We can bridge it to USB and mount it at proper location. USB helps to reduce interference. However, a cheap MPU6050 is good enough to do the job. |
The issue occurred when turning. There are errors in kinematics computed from wheels movement. The gyro meter yaw is used to correct the error. The EKF filter will fuse the wheels odometry and IMU to reduce the error. The covariance matrix is important. The EKF depends on the covariance matrix to compute the most likely pose of the robot. These are the things which we should check.
|
I have enabled the calibration of MPU6050. The MPU9250 might be able to use the MPU6050 driver. The MPU9250 integrates AK8963 magnetometer. The magnetometer will help the fusion after calibration. I have described the wiring, calibration and usage in my wiki. |
That’s some good news,
I will make some test tomorrow!!!
Regards,
Tuyishime Thierry
…On Wed, 15 May 2024 at 20:26, Thomas Chou ***@***.***> wrote:
I have enabled the calibration of MPU6050. The MPU9250 might be able to
use the MPU6050 driver. The MPU9250 integrates AK8963 magnetometer. The
magnetometer will help the fusion after calibration. I have described the
wiring, calibration and usage in my wiki.
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGMR3TISV5UYPXZMF3IDN3DZCOSEZAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJTGE3TKNRSHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Please take a screen shot or video of your rivz. |
Hey @hippo5329 , These are the updates after making some test.
rviz2.mp4The tf part makes the robot keep rotating
3.ros2 topic echo imu/data is giving the following result
|
@aimethierry Hi,
The EKF (ekf.yaml) takes vx vy yaw of odom/unfiltered and yaw of /imu/data to compute the /odom. Please bringup the robot. Do not move the robot. Check the values of odom/unfiltered. pose.position should be 0,0,0. pose.orientation should close to 0,0,0,1. twist should be all zeros. Your robot has four wheels. It looks like skid drive. But you have only two motors, right? How do you drive four wheels? What kinematic do you use? Have you tested the motors and encoders? Please post photos of your robot in whole and details. |
Thanks for quick reply and constant help,
` Yes for the robot i have 4 wheels but am only driving using 2wd. And this is the my ekf.yaml file `
` |
@aimethierry |
@aimethierry It looks like a bug in your custom motor/encoder driver. . vy should be zero as the robot can move only in x direction. 0.5 is the speed sent by teleop. It is not the speed read from encoder. |
@aimethierry It might not worth the effort to debug the custom driver. I would suggest remove the esp32 and connect odrive to jetson via USB CDC as I wrote before. You may connect mpu8250 to I2C bus of jetson after you have the motor controller works. There are ros2 drivers. |
@aimethierry Connect encoders to the odrive. |
@aimethierry Better switch to discussion board on my fork to avoid interfere with @tbalatka issue. This is not quite related to linorobot or esp32. |
You are right, let’s continue discussion on your fork
Thanks
Regards,
Tuyishime Thierry
…On Thu, 16 May 2024 at 18:33, Thomas Chou ***@***.***> wrote:
@aimethierry <https://github.com/aimethierry> Better switch to discussion
board on my fork to avoid interfere with @tbalatka
<https://github.com/tbalatka> issue. This is not quite related to
linorobot or esp32.
—
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGMR3TL7337YSQ7GMJIN7BDZCTNWJAVCNFSM6AAAAABG3AVLCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJVGY4TMMBQGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
https://github.com/hippo5329/linorobot2_hardware/discussions "issue" is for bug reporting. |
Hello, I installed Linorobot2 on a laptop running ROS2 Humble. On an ESP32 Wroom, I am running Linorobot2_hardware (Rolling branch). The lidar model I am using is YDLidar2 x4. Both the lidar and ESP32 are connected to the laptop on the robot via USB. The IMU is a MPU6050.
Odom is fine. RZIV2 updates the position of the robot on the grid no problem, as I drive the real robot forward and reverse. But when I turn the direction of the robot, the map generated looks like a Picasso painting, which makes sense since the real robot changed direction but the virtual robot remained pointed in the old direction, resulting in the new perspective of the room superimposed over the old perspective. (hope that makes sense).
There is obviously a break somewhere in communication with respect to the TF data. This is demonstrated in RVIZ2 where I can see the wheels are not rotating when the real robot moves.
To troubleshoot, I ran "ros2 topic echo /tf" and the values under "rotation" show, for example, z: 0.18919803956070486 and w: 0.9819389501523941. Those values change as I move the robot around using teleop_twist_keyboard, but the onscreen wheels remain static as the robot model sort of drifts along the grid.
I've tried both base_serial_port and micro_ros_transport methods on the ESP32, thinking maybe the serial connection or baud rate was at fault. I got the same results.
ROS is new to me and I'm learning as much as I can on my own without assistance -- but this TF issue has me totally stumped.
Any advice would be much appreciated.
BTW, I've included here a photo of my project. It's large (wheels are 8 inches diameter) stands 18" tall. I'm using 12V car seat motors attached to E6B2-CWZ6C encoders. It has incredible torque and it's very quiet (not permitted to have noisy robots in our household...lol). Motor controller consists of two BTS7960 modules. The laptop is an i3. Everything is powered by a 12V 6Ah LiFePO4 Battery. I designed and 3D printed all the parts.
The text was updated successfully, but these errors were encountered: