linorobot / linorobot2_hardware

Apache License 2.0
92 stars 84 forks source link

MicroRos Agent Stucked #88

Open AdibSuid opened 1 month ago

AdibSuid commented 1 month ago

I succesfully uploaded the firmware into teensy 4.0, but then when I run micro-ros-agent, it won't start any node as attached picture below:IMG_20240520_045350_912~2.png

I have tried to push the reset button then it become like this:IMG_20240520_045549_655~2.png

I also tried to unplug and plugged again teensy board then it become like this:IMG_20240520_045543_569~2.png

I'm using ros2 humble, but I already tried on ros2 galactic also. Already tried both on laptop and Raspberry Pi 4B.

hippo5329 commented 1 month ago

Please check your USB connection.

  1. lsusb
  2. ls /dev/tty*
hippo5329 commented 1 month ago

If you are new to micro-ROS, you may use pico and esp32 instead of teensy. Please check my wiki at https://github.com/hippo5329/linorobot2_hardware/wiki .

AdibSuid commented 1 month ago

If you are new to micro-ROS, you may use pico and esp32 instead of teensy. Please check my wiki at https://github.com/hippo5329/linorobot2_hardware/wiki .

can I use teensy and for your github repo?

hippo5329 commented 1 month ago

Yes, it should work. I suggested esp32 and pico because they are cheaper than teensy and have hardware encoder counters instead of the interrupt-driven on teensy. I have tested upload and connect to micro-ROS agent with teensy40 and teensy41. Though I do not use teensy to build robots and have not test teensy on real robots. There are issues in platformio teensy upstream, so the first upload to teensy might fail. But the second upload should success. It is not related to linorobot. You may use lino_base_config.h as a template and create your custom configuration. I have suggested test the micro-ROS agent connection with the micro-controller module alone before wiring and building the robot. BTW, Can you see the /dev/ttyACM0 device after upload?

hippo5329 commented 1 month ago

Test micro-ROS agent connection - Recommended

It is recommended to test the micro-ROS agent connection with the micro-controller module alone before wiring and building the robots. Choose the configuration you will use to build your robot. If you use teensy and lino_base_config, comment out the "#define USE_GY85_IMU" in lino_base_config.h.

Then build, upload and test the micro-ROS agent connection.

hippo5329 commented 1 month ago

Esp32 and pico are suggested because they are cheaper than teensy and have hardware encoder counters instead of the interrupt-driven on teensy. The hardware encoder counters can count up to MHz. It will be almost impossible for the more expensive teensy to reach this speed.

AdibSuid commented 1 month ago

Test micro-ROS agent connection - Recommended

It is recommended to test the micro-ROS agent connection with the micro-controller module alone before wiring and building the robots. Choose the configuration you will use to build your robot. If you use teensy and lino_base_config, comment out the "#define USE_GY85_IMU" in lino_base_config.h.

Then build, upload and test the micro-ROS agent connection.

I see, alright thanks

AdibSuid commented 1 month ago

Test micro-ROS agent connection - Recommended

It is recommended to test the micro-ROS agent connection with the micro-controller module alone before wiring and building the robots. Choose the configuration you will use to build your robot. If you use teensy and lino_base_config, comment out the "#define USE_GY85_IMU" in lino_base_config.h.

Then build, upload and test the micro-ROS agent connection.

May I know why need to comment out the IMU define?

hippo5329 commented 1 month ago

We would like the teensy module connects to micro-ROS agent without the IMU. If the IMU is enabled but failed to initialize, the teensy will stop and blink the LED 3 times per second. So we comment out the IMU. Only the teensy module alone is needed to perform this connection test.

graham-fleming commented 1 month ago

I am also having these problems.

Motor / encoder checks work - teensy40 firmware upload works - teleop_twist seems to function

But no motors moving

Is running the micro_ros_agent supposed to have more output?

Teensy light flashes 3 times repeatedly

Commenting out the IMU shows error about commenting out IMU

I am using IMU GY-521

After successful build ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0

Screenshot from 2024-05-25 20-15-22

Commenting out IMU

Screenshot from 2024-05-25 20-20-05

@hippo5329 @AdibSuid

hippo5329 commented 1 month ago

Please switch to my fork.

cd linorobot2_hardware/firmware git add . git commit -m "my lino" git remote add hippo https://github.com/hippo5329/linorobot2_hardware.git git fetch hippo git checkout -b hippo hippo/master

Comment out the GY85 in line_base_config.h, build, upload and test connection.

hippo5329 commented 1 month ago

Gy-521 is MPU6050.

graham-fleming commented 1 month ago

Oh nice I switched over to your fork and it seems to be working now

There is more output after running micro_ros_agent

Teensy has solid light - keys pressed for teleop_twist move wheels

Will investigate further

Thank you @hippo5329 for the work

Screenshot from 2024-05-25 21-46-46