Open Leesanhang opened 1 month ago
Btw, when I run git reset --hard
, it says: HEAD is now at 4804a0b Revert "clock: disable clock_gettime from micro_ros_platformio". Should I be worried about it?
I pushed update to support generic1, generic2 and esc motor interfaces. The "git reset --hard" message is fine. Now please git reset and pull my update. Remove the motor driver wires. Connect only mpu6050. Use the pin assignments in esp32_config.h .
git reset --hard git pull
Correct me if im wrong, but the ESP32 has no Pin 0 right?
I changed the motor interface pin assignments. It should work though I didn't test them yet. I ordered generic 1 similar to the cytron to test.
You are right. esp32 30 pins version does not have d0. I push another update for motor pins. please pull again. Then perform the tests.
git pull
Hi again, I'm trying to follow your steps closely for now. However, I am facing an issue. Every time I shut down my Pi and come back the next day, micro-ROS will just magically not work. Do you maybe have an idea on why this is happening?
What is the error message from micro-ROS agent? Check 'ls /dev/ttyU* -l" to the the access. Which micro-SD you use? Write speed of the memory card is important.
I mean, it just doesnt connect fully as usual. However, I just realised what the problem is.
There are a few parts to your steps: serial connection test, test sensors, test motors, and test acceleration right?
Starting from test sensors, I uncomment the MPU6050 line. That's when the connection is not complete when I run ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0 --baudrate 921600
. Is that normal?
I think the MPU might be the main problem in my case.
This is when MPU is commented out, while doing https://github.com/hippo5329/linorobot2_hardware/wiki#connect-micro-ros-agent-again-and-check-imudata-topic
(micro-ROS is working when MPU is not defined)
This is when MPU is uncommented, doing the same steps
(micro-ROS is not working when MPU is defined)
Hope this helps with helping me find out what my problem is ππΌππΌππΌ
Please uncomment the mpu6050 to enable IMU and run test_sensors. Press reset button to see the messages of i2cdetect.
If you have run this step, is the IMU reading correct in test_sensors?
In your previous message, micro-ros2 agent can not connect because the esp32 stopped when the IMU init failed. You should see the LED blinks 3 times per sec.
I ran the test_sensors commands and this is what i got.
The random characters are due to pressing the ESP reset button.
Yes, the LED blinks thrice if micro-ROS connection failed.
The IMU looks good in test_sensors. Now, upload firmware and check the monitor . Press reset button to see the messages.
cd firmware pio run -e esp32 -t upload pio device monitor -e esp32
The reading of IMU changed too much. Do not move the IMU and check test_sensors later. The reading should be close to 0,0,9.8 with normal stand.
We will check the firmware boot monitor message first.
This is when I ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0 --baudrate 921600
I did not touch the IMU. Not sure why the values are fluctuating about those values.
The message you just posted is topic echo /imu/data on another terminal. esp32 is connected to agent and the /imu/data topic looks fine.
Post the photos of wiring of your esp32 board wiring and mpu6050.
The imu will do self calibration. It will take a few seconds.
Here is the temporary wiring. I have not switched to a full scale wiring since the wiring will be messy if I include the encoders and motor drivers.
Blue: ESP Vin -> MPU Vcc Purple: ESP GND -> MPU GND White: ESP SCL(22) - > MPU SCL Grey: ESP SDA(21) -> MPU SDA
We run the i2c at 400Khz. The 2k pull up on sda scl are required at this speed. Otherwise, i2c communication will be unstable. You may reduce the i2c speed tp 100Khz temporarily if there is no pull up.
In esp32_config.h
Wire.begin(SDA_PIN, SCL_PIN); \
Wire.setClock(400000); \
}
change 400000 to 100000 for 100Khz.
Would this be okay? I connected the SDA and SCL pins through a 2k resistance before passing it to the MPU.
The changes I see in the terminal now is that the fluctuations are slowed down by alot. But the values dont change when I move the IMU around.
Wrong. I should draw a schematic.
Okay, but yea I understand my mistake. I interpreted "pull up" wrongly. My bad.
How about this?
Black (Top) is from 3v3
orange and yellow is from SDA SCL of the ESP respectively
Grey and white (bottom 2 wires) are to SDA and SCL of MPU respectively
The resistors are in the same column with both jumpers.
The value of pull up resisters does not have to be exact 2K. something around 2-2.2k will work. What are the resisters you have? If you have 1K, then put two 1K in series to get 2K.
Anyways. Your previous wiring might work. Try out.
Is this good? they're 1k resistors each.
Good. It should work.
This is my output now.
Look good.
I'll continue with test_motors now.
Btw, do I have to worry about the linear acceleration values? Im not moving the sensor.
The reading of the IMU looks good. Minor noise.
I just wanted to ask if GPIO pins 36 and 39 needs to be pulled high as well? Because I remember faintly that I did see that somewhere. Im asking this because I dont think Motor 1's encoder info is going to the ESP. Im not receiving the Motor 1 RPM. All other motors are fine.
no
take photo motor and encoder
This is my motor, with the default encoder. The motor is rated 24V, 6000rpm, with a 1:27 reducer. The encoder is the GMR type.
encoder: red to 3.3V black gnd white A green B You should add a LM1117-3.3V LDO for the encoder. Do not use 3V3 of esp32, because the motor wiring is very noisy.
LM1117 Vin = esp32 Vin 5V, gnd = gnd, Vout 3.3V to encoder Vcc
Hope this is good. (it's 3.3V)
I changed the whole motor itself and it works now.
I'm getting this warning, what does the warning mean? I followed your steps, connecting the esp then only Lidar.
The by-path were mine. You will need to use your by-path.
I can't seem to get past this step always.
Try connection dev with by-path
ros2 run micro_ros_agent micro_ros_agent serial --dev your- by-path --baudrate 921600
I didn't see your rplidar node.
cat ~/.bashrc
Please use copy & paste of your screen message. Do not use screen capture. It is difficult for me to check. My eyes are not so good.
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](https://github.com/hippo5329/linorobot2_hardware/assets/157510368/a778c4b7-b0b5-44ee-ade5-8b9efac8790c)
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!