Hi all,
I would like to share my work on integrating the AR3 with ROS and MoveIt. I've released a baseline version of my code with the necessary packages to get you started with controlling your own arm. I hope that it will be helpful for those looking to explore ROS and MoveIt.
The project is available at: https://github.com/ongdexter/ar3_core
I have implemented a joint position trajectory controller in the ros_control framework coupled with a simple position control on the Teensy. Tracking trajectories generated by MoveIt enables more complex behaviours like moving around obstacles.
I have included a basic implementation of the move group API which should be sufficient for simple tasks. However, I don't intend to develop a full GUI for teaching tasks as that falls outside of my intended use case and especially since Chris has already developed a very efficient tool for that in ARCS.
Everything is in C++, though the MoveIt Commander Python scripting interface can used to interface with the core software. I'll likely use it for a simple jogging tool, for instance.
You may have also noticed from the video that I've made some changes to the encoders as well. I've shifted the J2 and J5 encoders to the joints to ensure correspondence between the actual joint position and the model in MoveIt for motion planning. I'll detail those changes in a separate thread.
I intend to explore some vision-based planning and I'll be happy share my progress. I hope that some will find my work useful and I welcome any suggestions and contributions.
Cheers, Dexter
well done dexter and hope to see your new update.
Hi, Dexter, thanks for doing this development and making it available to us. I recently completed my AR3 build and I wanted to explore using ROS/MoveIt to control it. I have a Windows 10 PC, and I am new to ROS, MoveIt, Linux. In your Git repository you provide detailed instructions for installing ROS and MoveIt directly on Windows, but I didn't see anything on installing Gazebo. From what I've read on the Web installing Gazebo directly on Windows is possible by building it in Visual Studio, but is pretty complex and people have reported various errors in the process. Are you running Gazebo on windows, or are you running it on Linux? And if on Windows, did you have any problems? Can you share any tips? If on Linux (Ubuntu), do ROS/MoveIt and Gazebo talk to each other easily?
Thanks, Ray Kimber
Hi Ray, Gazebo is actually packaged in the ROS binaries for both Windows and Linux, so you do not need to build or install it separately. The ROS Melodic versions are quite stable so you should have no issues running them together on either operating system.
Great work Dexter. Please keep us posted about your progress
Here is my AR3 with ROS modules from Dexter. Works better than anything I tried. Thank you again for your work Dexter. BTW I used your "clean" version of AR3 source teensy sketch. Had to make a few modifications around configuration and limit switches since I am using Teensy 4.1 and one of my limit switches is magnetic sensor with analog output.
Very nice! Glad that you were able to get it up and running!
Hi,Alex,Can you share a few modifications of teensy 4.1?
Hi, Dexter, thanks again for your ROS and MoveIt packages. After taking a quick ROS course (ROS in 5 days from the Construct (it took more than 5 days 🙄) to get up to speed on the details of ROS, I started to implement your work on my Windows 10 PC running WSL (Windows Subsystem for Linux version 2). I am using ROS Melodic with Ubuntu 18.0.04. Before attempting to control the actual AR3 I set up everything to control the simulation on Gazebo and RViz. This also gave me an opportunity to learn more about MoveIt and Gazebo.
I was able to load and run your packages without much difficulty; my lack of experience with ROS and Linux made the effort take longer, but your instructions and files were perfect. Using the Move Group Python Interface I am able to set poses and joints in Python control programs to control the AR3 in Gazebo (a heads-up to others embarking on a ROS path: poses are described in quaternions, not Euler angles). Again, thank you very much for your contribution.
Unfortunately, when it came time to set up the control of the real AR3, I ran into some problems. I followed your instructions for setup (COM3, 115200 in the hardware_driver.yaml file), and loaded the baseline_with_ARCS Teensy sketch into the Teensy 3.5. I then tested the new sketch by running ARCS, which worked fine. This seemed to validate the COM3 serial connection to the Teensy. I killed ARCS and the Arduino IDE so there wouldn't be a conflict for COM3.
I then followed your instructions for controlling the real-world arm with MoveIt. I downloaded your updated ar3_hardware_bringup.launch file from GitHub and replaced the old one, and launched the file using roslaunch ar3_hardware_interface ar3_hardware_bringup.launch use_existing_calibrations:=true. I got the following errors (warnings):
on the stdout:
-- [WARN] Failed to connect to serial port
-- [rosout][WARNING] 2021-04-29 23:02:47,719: wait_for_service(/controller_manager/load_controller): failed to contact, will keep trying
from the master.log (I think this shows that the com parameters were read):
-- [rosmaster.master][INFO] 2021-04-29 23:02:47,328: +PARAM [/ar3/hardware_driver/baudrate] by /roslaunch
[rosmaster.master][INFO] 2021-04-29 23:02:47,328: +PARAM [/ar3/hardware_driver/serial_port] by /roslaunch
from the controller_spawner-2 log:
[rosout][WARNING] 2021-04-29 23:03:07,783: wait_for_service(/controller_manager/load_controller): failed to contact, will keep trying
[rosout][WARNING] 2021-04-29 23:03:17,807: Controller Spawner couldn't find the expected controller_manager ROS interface.
Thinking that "COM3" for the serial port didn't have any meaning in a Linux shell I tried replacing COM3 with ttyS3 and /dev/ttyS3 because I read on the web that with Windows WSL COMn gets mapped to /dev/ttySn on Linux. This didn't make any difference, however.
Anyway, I'd appreciate any insight you may have into this trouble, or even if the "failed to connect to serial port" is the cause of the "controller spawner couldn't find the expected controller_manager ROS interface." I don't think I understand these ROS software complexities well enough to troubleshoot much further.
Thanks, in advance,
Ray Kimber
Hi Ray,
Good to hear that you've managed to get started with the packages. From the error messages, it's clear that the issue is with the serial port connection; the subsequent messages are irrelevant. I should change the programme to exit immediately to reduce ambiguity.
On the issue with the serial port naming, you are exactly right that "COMx" is specific to Windows. On Ubuntu, USB devices will actually typically show up as "ttyACMx" (e.g. ttyACM0), "ttySx" is for hardware serial interfaces. There are several ways to check your device port name but the simplest would be to `ls /dev/` and look for the new entry after you've connected your USB device.
However, there is a bigger issue here which is that WSL does not natively support USB passthrough. I'm not sure if you've worked around that but if you haven't, there most likely isn't even a USB connection to your WSL VM. I'm assuming that your test with ARCS was done on the Windows host and not in WSL. I actually tried working with WSL for awhile too but eventually gave it up. On that note, I did manage to get USB passthrough working with a regular VM (VirtualBox) but the performance was too slow for real-time communication. I would recommend just working with the host OS instead, be it Windows or Ubuntu.
Hope this helps!
Dexter
Hi Dexter,
I tried your software and it works so well!
Thank you for sharing your efforts.
Cheers,
Michael.
Hi, thanks for sharing this
I encountered this problem at run time
How to solve it 📌
[ERROR] [1640314078.346581191]: Unable to identify any set of controllers that can actuate the specified joints: [ joint_1 joint_2 joint_3 joint_4 joint_5 joint_6 ]
[ERROR] [1640314078.346608044]: Known controllers and their joints: