Made a plan, did step one and step two.. Now lets start step three: install and setup ROS.
For this part I decided to cheat and do this the easy way.... I installed a virtual desktop software and a VM image of Ubuntu with ROS already installed. The process was super simple and I didn't have to worry about resizing partitions of my daily use computer (or wasting a day doing installs and updates). I found this sucker from the ROS 101: Drive a Husky! page here: https://www.clearpathrobotics.com/2014/03/ros-101-drive-husky/
And the VM tool (VM Player), I used I got from here: https://www.vmware.com/products/workstation-player.html
With that the work of getting everything started was substantially reduced to the point of sheer laziness.
From here as it was written in the tuts: the password is: learn
Now, open up a terminal and update and upgrade that bad boy with a easy copy and paste of: sudo apt-get update && sudo apt-get upgrade -y
Next, setup the workspace: mkdir -p ~/catkin_ws/src ; cd ~/catkin_ws ; catkin_make
Then a quick: source devel/setup.bash
And an easy: echo $ROS_PACKAGE_PATH /home/user/catkin_ws/src:/opt/ros/hydro/share
We just have to move to the main work space area. To do so, we simply time the magic words: roscd ; cd ../src
From there we will make our own work space and then download out motor drivers.
Do so with this command: git clone https://github.com/sonyccd/roboclaw_ros.git
Type cd ../ ; catkin_make ; source devel/setup.bash
We need to set up some of the parameter stuff before we try to execute this (this is found in the launch file).
We need to type something like this: roscd ;cd ../src/roboclaw_ros/roboclaw_node/launch ; nano roboclaw.launch
Now lets edit the parameters to what we need. I am going to change the ticks per meter to 10384.6 and the base width to .49.
*Your data will be different if you have a different platform or encoders.*
We need to make sure that the PID stuff is good and then we can test out this feller!
I messed up and disconnected the +5v lines to the encoders. It wasn't super obvious due to the garbage wiring job I have done (I did this because the pins on the headers to connect the encoder parts felt too loose. I added black tape to try for a tighter fit.
*Another day was wasted on trying to get the roboclaw working through the virtual machine--I switched to an old machine that I did everything on last year (I almost forgot the password and the battery was dead).
I missed a big detail that put me at looking like a Linux noob. I forgot to give myself permissions to the USB to serial stuffs. All I had to do was ask the devil for help with this trusty command:
chmod 666 /dev/ttyacm0
After that command, I was able to make stuff happen. Which makes me ask, "who's power is Satan?" But, music played backwards aside, I really tried three different ways to make it work before I had seen the light.
*For those who don't get the command or the jokes: the command gives everyone the ability to read and write to the given device, and I used the 666 as a play on the number of the beast and Stairway to Heaven played backwards.
We need some stink'n video! Hey, play that beautiful motor controlling footage.
This video shows that the motors, encoders, and motor controller works well with computer control... I didn't video the computer in this one...
This one shows the computer publishing to the topic to make the wheels move. It took a couple times to get it to work, but it works, unlike some people..... That was a stab at my roomba and botvac.
Cool beans! Now I have a big win under my belt (don't remind me how it took a week and a half, and I won't bring up that it took a year for you to learn to run), I can start moving on to other parts of the machine.
Next, I will work on the IMU portions. I will follow the same procedure as with the motor controller steps/stages (make a plan, gather parts, test the parts, and try to make it work with ROS.
Enjoy the videos suckers! I am off to a victory nap. See you in a few days!
7/4/18