On robot's computer, install ros2-android-demo & run demo_install.sh:
cd ~/catkin_ws/src
git clone https://github.com/songshan0321/ros2-android-demo.git
cd ~/catkin_ws/src/ros2-android-demo/scripts
./demo_install.sh
On server computer, create a symlink of bringup.sh at root directory:
git clone https://github.com/songshan0321/ros2-android-demo.git
ln -s ~/github/ros2-android-demo/scripts/bringup.sh ~/bringup.sh
On server computer, git clone virtual-joystick library:
cd ~/github/ros2-android-demo/app/base_controller
mkdir libs
cd libs && git clone https://github.com/controlwear/virtual-joystick-android.git
On robot's computer, download and install ros2-android-demo:
cd ~/catkin_ws/src
git clone https://github.com/songshan0321/ros2-android-demo.git
# install serial package as dependencies
git clone https://github.com/wjwwood/serial.git
# Start catkin make
cd ~/catkin_ws && catkin_make
# Copy 2 yaml files into soss configs folder
cp src/ros2-android-demo/configs/android_ros2_ros1.yaml ~/rmf/src/soss/configs/android_ros2_ros1.yaml
cp src/ros2-android-demo/configs/android_ros1_ros2.yaml ~/rmf/src/soss/configs/android_ros1_ros2.yaml
Manually add required msgs into soss_msgs yaml file, then rebuild SOSS:
echo -e " - std_msgs/Int16 \n - geometry_msgs/Vector3 \n - geometry_msgs/Twist" >> ~/rmf/src/rmf/soss/interfaces.yaml
cat ~/rmf/src/rmf/soss/interfaces.yaml
cd ~/rmf/src/rmf/scripts && ./generate_soss.sh
# Added additional msgs to SOSS successfully!
Install PlatformIO and upload compiled Arduino base code:
pip install -U platformio
cd ~/catkin_ws/src/ros2-android-demo/platformio/car_base/
platformio run -e uno --target upload
On server computer, create a symlink of bringup.sh at root directory:
git clone https://github.com/songshan0321/ros2-android-demo.git
ln -s ~/github/ros2-android-demo/scripts/bringup.sh ~/bringup.sh
Follow instruction from ros2-android-app to compile the project for further development.
On server computer, bring up robot:
Note: input user@host and password of robot's computer accordingly.
./bringup.sh
On robot's computer,
Run subscriber on robot:
. ~/catkin_ws/devel/setup.bash
echo rmf1234 | sudo -S chmod 777 /dev/ttyACM0
roslaunch remote_robot_android car.launch
On another terminal, source the SOSS libraries and start a SOSS instance:
. ~/rmf/build/soss/setup.bash
cd ~/rmf/src/soss/soss
./soss.py ../configs/android_ros2_ros1.yaml
On another terminal, source the SOSS libraries and start a SOSS instance:
. ~/rmf/build/soss/setup.bash
cd ~/rmf/src/soss/soss
./soss.py ../configs/android_ros1_ros2.yaml
Start control your robot by Android App from mobile. Have fun!
On server computer, echo /cmd_vel & /ldr_value topic:
. ~/rmf/build/ros2/install/setup.bash
ros2 topic echo /cmd_vel
ros2 topic echo /ldr_value