Open Leesanhang opened 4 months ago
The Vin and GND means the main 24V power right? not the signals?
Oh I'm not too sure about the wire AWG then. Maybe the seller labelled it wrongly. But anyways, I did confirm that it can support way over the motor rating.
Yes, the Vin and GND means the main 24V power. Add the cap on the motor controller board.
Okok, got it. Just wanted to clarify it. Thanks, I'll try it.
The problem was the polarity.
However, I am facing a micro-ROS issue now and I'm hoping to get some guidance on this. This is when I run the robot bringup command.
leesanhang@Pi4B:~$ ros2 launch linorobot2_bringup bringup.launch.py base_serial_port:=/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-port0 lidar_serial_port:=/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0 [INFO] [launch]: All log files can be found below /home/leesanhang/.ros/log/2024-05-31-05-35-05-279499-Pi4B-4745 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [ekf_node-1]: process started with pid [4813] [INFO] [micro_ros_agent-2]: process started with pid [4815] [INFO] [joint_state_publisher-3]: process started with pid [4817] [INFO] [robot_state_publisher-4]: process started with pid [4820] [INFO] [sllidar_node-5]: process started with pid [4827] [micro_ros_agent-2] [1717104913.972887] info | TermiosAgentLinux.cpp | init | running... | fd: 3 [micro_ros_agent-2] [1717104913.973905] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4 [micro_ros_agent-2] [1717104914.182600] info | Root.cpp | create_client | create | client_key: 0x604407F2, session_id: 0x81 [micro_ros_agent-2] [1717104914.182787] info | SessionManager.hpp | establish_session | session established | client_key: 0x604407F2, address: 0 [robot_state_publisher-4] [INFO] [1717104914.457506579] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-4] [INFO] [1717104914.457979727] [robot_state_publisher]: got segment base_link [robot_state_publisher-4] [INFO] [1717104914.458082561] [robot_state_publisher]: got segment camera_depth_link [robot_state_publisher-4] [INFO] [1717104914.458122487] [robot_state_publisher]: got segment camera_link [robot_state_publisher-4] [INFO] [1717104914.458151116] [robot_state_publisher]: got segment front_left_wheel_link [robot_state_publisher-4] [INFO] [1717104914.458178802] [robot_state_publisher]: got segment front_right_wheel_link [robot_state_publisher-4] [INFO] [1717104914.458307857] [robot_state_publisher]: got segment imu_link [robot_state_publisher-4] [INFO] [1717104914.458351857] [robot_state_publisher]: got segment laser [robot_state_publisher-4] [INFO] [1717104914.458382746] [robot_state_publisher]: got segment rear_left_wheel_link [robot_state_publisher-4] [INFO] [1717104914.458412209] [robot_state_publisher]: got segment rear_right_wheel_link [micro_ros_agent-2] [1717104914.466890] info | ProxyClient.cpp | create_participant | participant created | client_key: 0x604407F2, participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.498531] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x604407F2, topic_id: 0x000(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.514749] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x604407F2, publisher_id: 0x000(3), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.530972] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x604407F2, datawriter_id: 0x000(5), publisher_id: 0x000(3) [sllidar_node-5] [INFO] [1717104914.541342727] [sllidar_node]: SLLidar running on ROS2 package SLLidar.ROS2 SDK Version:1.0.1, SLLIDAR SDK Version:2.1.0 [micro_ros_agent-2] [1717104914.547264] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x604407F2, topic_id: 0x001(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.558755] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x604407F2, publisher_id: 0x001(3), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.566465] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x604407F2, datawriter_id: 0x001(5), publisher_id: 0x001(3) [micro_ros_agent-2] [1717104914.576680] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x604407F2, topic_id: 0x002(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.590002] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x604407F2, publisher_id: 0x002(3), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.610584] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x604407F2, datawriter_id: 0x002(5), publisher_id: 0x002(3) [micro_ros_agent-2] [1717104914.615586] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x604407F2, topic_id: 0x003(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104914.621520] info | ProxyClient.cpp | create_subscriber | subscriber created | client_key: 0x604407F2, subscriber_id: 0x000(4), participant_id: 0x000(1) [sllidar_node-5] [INFO] [1717104914.625870875] [sllidar_node]: SLLidar S/N: 6BE69A86C0E09CC7A2E09DF7F9343077 [sllidar_node-5] [INFO] [1717104914.626406875] [sllidar_node]: Firmware Ver: 1.25 [sllidar_node-5] [INFO] [1717104914.626509357] [sllidar_node]: Hardware Rev: 5 [sllidar_node-5] [INFO] [1717104914.633722320] [sllidar_node]: SLLidar health status : 0 [sllidar_node-5] [INFO] [1717104914.633914061] [sllidar_node]: SLLidar health status : OK. [micro_ros_agent-2] [1717104914.674358] info | ProxyClient.cpp | create_datareader | datareader created | client_key: 0x604407F2, datareader_id: 0x000(6), subscriber_id: 0x000(4) [sllidar_node-5] [INFO] [1717104914.984629783] [sllidar_node]: current scan mode: Express, sample rate: 4 Khz, max_distance: 12.0 m, scan frequency:10.0 Hz, [joint_state_publisher-3] [INFO] [1717104916.308042356] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic... [micro_ros_agent-2] [1717104930.907725] info | Root.cpp | delete_client | delete | client_key: 0x604407F2 [micro_ros_agent-2] [1717104930.909726] info | SessionManager.hpp | destroy_session | session closed | client_key: 0x604407F2, address: 0 [micro_ros_agent-2] [1717104930.938645] info | Root.cpp | create_client | create | client_key: 0x57A4A9FF, session_id: 0x81 [micro_ros_agent-2] [1717104930.938714] info | SessionManager.hpp | establish_session | session established | client_key: 0x57A4A9FF, address: 0 [micro_ros_agent-2] [1717104931.010435] info | ProxyClient.cpp | create_participant | participant created | client_key: 0x57A4A9FF, participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.015549] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x57A4A9FF, topic_id: 0x000(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.019623] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x57A4A9FF, publisher_id: 0x000(3), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.026763] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x57A4A9FF, datawriter_id: 0x000(5), publisher_id: 0x000(3) [micro_ros_agent-2] [1717104931.031753] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x57A4A9FF, topic_id: 0x001(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.036422] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x57A4A9FF, publisher_id: 0x001(3), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.042683] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x57A4A9FF, datawriter_id: 0x001(5), publisher_id: 0x001(3) [micro_ros_agent-2] [1717104931.048564] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x57A4A9FF, topic_id: 0x002(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.055204] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x57A4A9FF, publisher_id: 0x002(3), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.072656] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x57A4A9FF, datawriter_id: 0x002(5), publisher_id: 0x002(3) [micro_ros_agent-2] [1717104931.090499] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x57A4A9FF, topic_id: 0x003(2), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.095011] info | ProxyClient.cpp | create_subscriber | subscriber created | client_key: 0x57A4A9FF, subscriber_id: 0x000(4), participant_id: 0x000(1) [micro_ros_agent-2] [1717104931.107278] info | ProxyClient.cpp | create_datareader | datareader created | client_key: 0x57A4A9FF, datareader_id: 0x000(6), subscriber_id: 0x000(4)
When I continuously press on for example: forward, the client and session is destroyed. The issue is when I start running the robot controller - teleop_twist_keyboard and try to move the robot, the micro-ROS will suddenly disconnect and cause a major lag in my robot movement.
This issue still persists. The micro-ROS keeps disconnecting halfway, making my robot very laggy.
Have you tried reduce the motor max rpm and current with
And try teleop with the robot lift above ground ( wheels do not touch ground). Please take a photo of your robot from top and photos of your wiring. I want to see all four wheels.
Okay, I just did the changes to the esp32 config file. From what I observe, the movement is slightly better I think.
Btw, this is my robot currently.
What is the 4.9 step down used for? The encoders should be powered by 3.3V. What is the 3.58 displayed for?
Oh, the 4.9V is actually for Pi. But I'm using the original power source for now. The 3.58V is for displaying the overall battery and individual cell voltage level to prevent over-discharging the batteries.
Actually, Im not too sure if its a power issue at all.
Before this, I was running ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0 --baudrate 921600
(to check micro-ROS connection).
Then I tried to use ros2 run teleop_twist_keyboard teleop_twist_keyboard
to move the robot.
There was no latency between the Pi and the ESP. Not sure why is the problem only occuring now.
I suspected it was the MPU problem actually. I commented out the #define MPU line and the robot is moving perfectly.
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.
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.
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.
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.
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
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?
Good.
"is Cartographer or GMapping used to run SLAM?", I don't know. I am new to ROS/NAV, too.
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?
ros2 run tf2_tools view_frames
It returns the error: the following arguments are required: executable_name, argv
sudo apt-get install ros-humble-tf2-ros ros-humble-tf2-tools
It works, thank you.
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?
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.
So, actually, AMCL does not just auto-detect where the robot is when RViz is launched?
No. In case there are multiple rooms, there is no way to determine which room the robot is in.
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.
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.
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?
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?
Please describe the moving issue.
Have you enabled the IMU?
Have you adjust the velocity_smoother parameters for Y and reduced accelerations?
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.
Hi, so I've been trying your suggestions.
Did you place the IMU on prototype board? IMU is important.
Try lower the accel to 1/2 the values.
I pasted the wrong line. in esp32_config.h,
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.
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 ?
Between 0.49-0.67. You may try 0.6. Check the error when robot turn and try other values.
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.
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.
Good. The starter robot is a learning tool.
Thomas Chou
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:
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:
Any help to solve this issue is much appreciated, Thank youu!