Setup ROS on Jetson TX2 and Run turtlesim

For coding on Jetson TX2, considered some frameworks such as VisionWorks, openFrameworks and Cinder. But as you know, they don’t support “aarch64” officially or few information on the internet. Eventually decided to use ROS. This post is about setup memo of ROS and how to run sample program of turtlesim.

Environment

  • Jetson TX2
  • Ubuntu 16.04
  • ROS Kinetic

Delete old ROS

If you have.

$ rosversion -d
kinetic
$ sudo apt-get purge ros-kinetic-*
$ sudo apt autoremove

Create virtual environment

To avoid conflict with OpenCV.

$ pip install virtualenv
$ virtualenv venv_ros
$ source venv_ros/bin/activate

Install ROS

$ cd ~/Downloads
$ git clone https://github.com/jetsonhacks/installROSTX2.git
$ cd installROSTX2
$ ./installROS.sh -p ros-kinetic-desktop -p ros-kinetic-rgbd-launch

Setup Workspace

$ ./setupCatkinWorkspace.sh
$ cd ~/catkin_ws/
$ source /opt/ros/kinetic/setup.bash

Install turtlesim

$ rosversion -d
kinetic
$ sudo apt-get install ros-kinetic-turtlesim

Run Keyboad Control turtlsim

Should run three terminals.

$ roscore
...
started core service [/rosout]
$ rosrun turtlesim turtlesim_node
[ INFO] [1531809691.854791711]: Starting turtlesim with node name /turtlesim
[ INFO] [1531809691.926926757]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
$ rosrun turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.

Finish !

Check rqt_graph

Open new terminal and run below.

$ rosrun rqt_graph rqt_graph

Reference