Skip to content

Tinker-Twins/F1TENTH-Mocap-Data-Recording-Pipeline

Repository files navigation

F1TENTH Mocap Data Recording Pipeline

F1TENTH within OptiTrack Motion Capture Area F1TENTH with 4 X-Base Passive Reflective Markers
OptiTrack Mo-Cap Ground Plane Setup OptiTrack Mo-Cap Asset (Vehicle) Setup
OptiTrack Mo-Cap System Setup, Calibration and ROS Integration Tutorial Video

SETUP (Vehicle On-Board Computer)

  1. Clone this repository.
    $ git clone https://github.com/Tinker-Twins/F1TENTH-Mocap-Data-Recording-Pipeline.git
  2. Move the autodrive and f1tenth directories from the Vehicle Software directory to the source space (src) of the Catkin workspace on the vehicle computer.
    $ mv ~/Vehicle\ Software/autodrive ~/catkin_ws/src/
    $ mv ~/Vehicle\ Software/f1tenth ~/catkin_ws/src/
  3. Build the packages.
    $ cd ~/catkin_ws
    $ catkin_make
  4. Source the setup.bash and/or .bashrc as needed.
    $ source ~/catkin_ws/devel/setup.bash
    $ source ~/.bashrc

SETUP (Remote PC Connected to OptiTrack Mocap System)

  1. Install mocap_optitrack ROS package:

    $ sudo apt-get install ros-<distro>-mocap-optitrack

    References:
    http://wiki.ros.org/mocap_optitrack
    https://tuw-cpsg.github.io/tutorials/optitrack-and-ros/

  2. Source the setup.bash and/or .bashrc as needed.

    $ source /opt/ros/<distro>/setup.bash
    $ source ~/.bashrc

    Note: There may be a need to clone and build vehicle packages on the remote PC connected to OptiTrack Mocap system as well, so that any custom message definitions are compiled and recorded to the bag file.

USAGE

  • [Terminal Window 1] Mocap Bringup: Launch the mocap.launch file from mocap_optitrack package on remote PC.

    $ roslaunch mocap_optitrack mocap.launch & rosrun rviz rviz

    Note: F1TENTH_Mocap.rviz configuration file could be used for convenient visualization of vehicle pose w.r.t. world frame.

  • [Terminal Window 2] Open-Loop Control: Launch the open_loop_ctrl_autodrive.launch file from racecar package on vehicle computer (SSH into vehicle computer). Pass commandline arguments as applicable to the open-loop control test/scheme.

    $ ssh ccri-car-1@192.168.2.103
    $ roslaunch racecar open_loop_ctrl_autodrive.launch velocity:=<velocity> steering:=<steering> velocity_noise:=<velocity_noise> steering_noise:=<steering_noise>
  • [Terminal Window 3] Data Recording: Record contents of all topics to a bag file with a custom name.

    • Command line option:
    $ cd <path/to/directory/to/save/bag/file(s)>
    $ rosbag record -a -O <bag_file_name>.bag
    • Launch file option (supports topic throttling):
    $ roslaunch racecar mocap_data_recording.launch rosbag_dir:=<path/to/directory/to/save/bag/file> rosbag_name:=<bag_file_name>.bag