Step by step guide - SamKnoors/Spyker-Lapland-Robotics GitHub Wiki
Welcome to the Spyker Lapland Robotics wiki! Here, you can follow a step-by-step guide to reproduce this project by yourself.
Basic knowledge of ROS and Linux.
A tracked vehicle called Spyker.
Jetson TX2 with the Ubuntu 18.04 jetpack installed.
ESP32 or another microcontroller with at least 3 hardware UART. (Serial connection included)
Stereolabs ZED2 stereo cam.
Slamtech RPLiDAR A3.
Flipsky BLDC motors 140KV.
Flipsky FSESC 6.6.
Batterypack between 12 and 42 V
Follow this tutorial to install ROS Melodic onto the Jetson TX2.
Next, clone this repository into the home folder and go to the catkin_ws directory.
git clone <repolink!>
cd ~/catkin_ws
Run catkin_make
to install all the nodes.
the wiring is pretty straightforward. First, hook the motors up to the ESC. The order of the coil wires does not matter since the controller will handle this. The sensor cables have connectors that only fit in the desired sockets. But, be sure to put the connector onto the socket with its corresponding motor. In the figure below, you can see how to hook up the ESP32 to the motor controller. The RX to TX and TX to RX.
In the next picture, you can see how to wire three ultrasound sensors to ESP32. The left sensor goes to pin 12, the right sensor to pin 14, and the centre sensor goes to pin 27.
The ESP32 is responsible for controlling the motors over UART and gets commands from the ROS master. Load the code from the folder ESP_Code into the controller using the Arduino IDE. This code transforms the velocity command message from ROS to differential drive values and sends that to the motor driver. it also checks if the ultrasound sensors have a clear path and if not the ESP32 will stop the motors immediately. An RC receiver can also be attached to the microcontroller in order to control the robot manually. By tapping two times forward throttle, this mode is activated and will stop after 10 seconds of inactivity. The ESP32 is connected to the Jetson, using a USB cable.
One option to start the robot is installing ROS on a separate Linux machine and log in to the Jetson using ssh. then add the following lines to the bottom of the .bashrc file. sudo nano .bashrc
export ROS_MASTER_URI=http://<Jetson'sIP>:11311
export ROS_IP=<Jetson'sIP>
export ROS_HOSTNAME=<Jetson'sIP>
Now go to the external Linux machine and go to that same file. put the following lines at the bottom. sudo nano .bashrc
export ROS_MASTER_URI=http://<Jetson'sIP>:11311
export ROS_IP=<ExternalmachineIP>
export ROS_HOSTNAME=<ExternalmachineIP>
Note! An installed ROS version on the external machine is needed in order for this to work.
Another way to start all the needed application is by using a VNC connection between the Jetson and another computer. But, since this can be very slow, the first option is recommended.
Now, when logged on to the Jetson, run the following command:
roslaunch spyker_navigation test.launch
After running this, all the necessary nodes will start. the next step is starting rviz to visualize everything.
make sure that the rviz file located in this repository is available on the external machine. Run the following command:
rosrun rviz rviz -d <path to rviz file>
At this point, a map should show up. this is a live map and after setting a 2D nav goal, the robot should drive towards that direction and stops when it reaches its destination.