linorobot / linorobot2_hardware

Apache License 2.0
104 stars 90 forks source link

The firmware was uploaded but nothing's happening. #4

Closed Shromm-Gaind closed 2 years ago

Shromm-Gaind commented 2 years ago

I have followed the guide on how to configure the hardware of linorobot, and got past the point of uploading firmware onto the Teensy 4.0 (everything up to this point is successful). However, once I try and drive it around and enter the keys to move it forward and backward nothing happens. I have looked at the troubleshooting guide, but I am very confident I am using the Teensy 4.0.

grassjelly commented 2 years ago

Could you describe what's your setup like (OS, ROS2 Distro)? Are you running any of the OS on a VM?

Shromm-Gaind commented 2 years ago

I am using Ubuntu 20.04.1 and ROS2 Foxy. I am able to get to the point on the terminal where it shows me the keys and how to operate it. The motors are spinning when I am using the calibration software and in the right orientation.

grassjelly commented 2 years ago

Is the Teensy’s LED flashing even without pressing any keys?

Shromm-Gaind commented 2 years ago

It isn't flashing.

Shromm-Gaind commented 2 years ago

The LED is on when this command is run ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0.

Cheason28 commented 2 years ago

Actually I am having a similar issue where I can spin and sample the motors in calibration but once I upload the robot firmware, the whole world stopped. After running "pio run --target upload -e teensy31" in folder linoronot2_hardware/firmware, the upload was successful. However, once the upload is done, my whole ubuntu will just freeze. The terminal is freezed, and neither my mouse nor keyboard works. However the system is still running because the time on top of the screen is till working. If I cut the power of the robot computer and turn it back on, the teensy is simply gone (cannot be detected) If I try to run "ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM1" (its ttyACM1 because ttyACM0 is taken by the build in arduino of the lattepanda), it says serial port not found.

I am using a LattePanda V1 and a teensy 3.2 (teensy 3.2 should be the same as teensy 3.1 as they share the same chip except that teensy 3.2 has a better power supply, so when uploading the firmware I used teensy31 as the model)

grassjelly commented 2 years ago

Could you try uploading a simple microros 'hello world' firmware using this https://github.com/linorobot/micro_ros_platformio. Use the same platformio config as linorobot2.

It's supposed to publish an incrementing number on micro_ros_arduino_node_publisher topic.

Cheason28 commented 2 years ago

Thank you for your advice! We've managed to upload the "hello world" firmware. Unfortunately, the nodes are not being set up and the topics are not advertised as shown in these screenshots. We appreciate any advice on how to proceed Screenshot from 2022-03-24 19-20-46 Screenshot from 2022-03-24 19-21-50 Screenshot from 2022-03-24 19-22-02 .

grassjelly commented 2 years ago

Looks like you have one more device in the /dev/ttyACM* port. Can you confirm that you are assigning the correct serial port?

Shromm-Gaind commented 2 years ago

I am still having the issue. Where the calibration when run using screen /dev/ttyACM0. I get the wheels to spin forward, I get the encoders values etc. However when I try and run telop nothing is happening, it doesn't even move forward. Is it possible I am configuring it wrong?

grassjelly commented 2 years ago

I've updated the firmware recently, could you pull and try the latest version?

Shromm-Gaind commented 2 years ago

Will do so, and let you know. Is it possible that the reason for the robot to not move after the calibration is likely due to micro_ros not communicating with the teensy board. Because as far as I can see the calibration doesn't require micro_ros.

grassjelly commented 2 years ago

yes could be related to this https://github.com/linorobot/linorobot2_hardware/commit/5220465a93f59b0763719397de1c76aa076b1e59

grassjelly commented 2 years ago

hey @Shromm-Gaind. Did my previous answer resolve your issue? Could you try uploading the most recent firmware

Shromm-Gaind commented 2 years ago

I have done so, but teleop_twist_keyboard still doesn't work. I think it is just micro_ros, but when I run the agent, there are no bugs or problems.

grassjelly commented 2 years ago

are you running teleop_twist_keyboard from the same machine where the agent resides?

Shromm-Gaind commented 2 years ago

Yes

grassjelly commented 2 years ago

does the Teensy's LED flash (fast rate) when you press a control key from teleop_twist_keyboard

Shromm-Gaind commented 2 years ago

No, should it?

grassjelly commented 2 years ago

Just curious aside from the robot's Teensy controller, are there any USB device connected to the robot's computer? If so, could you remove everything except the Teensy controller? Just to ensure there's no serial port clash or anything.

Shromm-Gaind commented 2 years ago

No, there are no other serial connections

grassjelly commented 2 years ago

Alright, it seems that the agent is not picking up the Twist msgs. The Teensy's LED is supposed to flash when Twist commands are received. Could you do this simple agent test https://github.com/linorobot/micro_ros_platformio and check if you're able to echo the data.

Shromm-Gaind commented 2 years ago

I believe that it might be my Teensy having some problem at this point. I have a spare one at my uni. Will try that out and let you know.

grassjelly commented 2 years ago

Alright, let me know how the agent test go. Thanks

Shromm-Gaind commented 2 years ago

I have managed to solve the issue, I did replace the teensy, but that did not work as expected. But, I swapped from using a Intel Nuc to a raspberry pi 4 and it seems to work.

Shromm-Gaind commented 2 years ago

I should have checked earlier if the Nuc was compatible, my fault. Thanks a lot with the help though.

grassjelly commented 2 years ago

Thanks! Closing this for now