Open haochengao opened 1 month ago
The log message below about waiting for /dev/ttyACM0
looks suspicous to me.
[ros2_control_node-1] [INFO] [1722056924.569124487] [teensy_driver]: Waiting for response from Teensy on port /dev/ttyACM0
If you enable calibration with calibrate:=True
, does the arm move and run it's calibration sequence?
Se1exin is correct, looks like Teensy isn't responding. You can troubleshoot this using Arduino's Serial Monitor, see if you can connect to the teensy (with baud rate 9600) and send commands to it. i.e. sending JC
should start the calibration routine, and sending JP
should return the current position.
I'm also having the exact same issue. So far, it seems like something in the sketch is mishandling serial communication. I created a very simple test program over the same serial connection that echoes back what I sent via the serial monitor that worked, so that at least isolates the issue to the sketch (I'm using AR4_MK2_MK3.ino).
It looks like others have no issues with serial communication with the MK3, see: https://github.com/ycheng517/ar4_ros_driver/issues/15 . I don't think it's a systematic issue as I know quite a few people that have gotten everything to work with MK2 and the original version, and MK3 shouldn't be that different.
I again recommend trying to use the Arduino Serial Monitor to communicate with the Teensy 4.1 running the firmware sketch. I also suggest getting the robot working with the official Annin Robotics Control Software and ensure there's no issues there.
One thing I find that often messes with microcontrollers is the USB cable, both it's length and the quality of the cable itself. I have a handful of USB cables that work with all my devices except arduinos/ESPs/teensies, and it seems it's mostly the thicker, short length, cables that do work.
I also get intermittent disconnections when using a USB hub, so instead I try to plug directly into my machine when possible. USB extension cables nearly always cause issues too - I recently upgrade to an expensive 2 meter long one and it does work though.
Finally, noise in the power circuits of your circuits (e.g. in the robot arm circuitry) can cause flakely behavior for USB comms and other functions of the microcontrollers. On my ARM-MK2 I have put capacitors on every single wire that goes to a motor, and I've also wired absolutely every separate circuit to a common ground.
In summary there a many hardware-level things that could be causing the USB to not work 100%, I would be checking my circuits and cables before looking at software as being the cause.
Edit: Here is a pic of my teensy with the capacitors, they're a bit hard to see so I've circled them in red:
Thanks for the replies. Serial communication is working correctly for me with the latest MK3 sketch pushed yesterday.
glad to hear it's working @zhelfer0306 , and nice tips @se1exin
Hey, big thanks for creating this great project. I'm having an issue getting the real world control up and running. Here's the command I'm trying:
ros2 launch ar_hardware_interface ar_hardware.launch.py ar_model:=ar4_mk3 calibrate:=False include_gripper:=False
which results inThe last 2 messages repeat indefinitely. When I look at
ros2 node list
here is what I see:and
ros2 service list
:I'm not sure why this is happening since it looks like the controller_manager services are up and running?