Skip to content

Pre Calibration File Configuration

bsubbaraman edited this page Apr 7, 2020 · 11 revisions

File Configuration

This section describes how to configure a few OpenPTrack files that will allow each node to communicate properly across the network, and identify their associated imager. This is necessary only for a multi-camera system- if running single camera, you can move on to single camera tracking.

1. Modify the .bashrc.

Every sensor should be connected to a PC on the same Gigabit Ethernet network. One PC will be the master, where the calibration code and the tracking code will run, while the other PCs will run the sensor drivers (during calibration) and the people detection code (during distributed detection and tracking). To allow communication between software nodes in different computers, the environment variable ROS_MASTER_URI on every client PC must be set to the IP address of the master PC. Additionally, the ROS_IP and ROS_PC_NAME environment variables must be set on every PC. These variables should be set with the following information:

ROS_MASTER_URI=http://<MASTER_IP>:11311/
ROS_IP=<MACHINE_IP>
ROS_PC_NAME=<MACHINE_NAME>

Note that the PC names to be assigned can be whatever the user wants, not necessarily related to the real name of the PCs. The naming convention generally used is PC# (e.g. PC1, PC2, etc).

If you are using Docker Images:

All you need to do is edit the ros_network.env file inside the open_ptrack_docker_config folder with the information described above:

cd ~/open_ptrack_docker_config/multi_camera_tracking
gedit ros_network.env

The ROS_KINECT_NAME parameter can be ignored for now.

If you are not using docker images:

Setting the variables can be done temporarily on a terminal by typing the following commands:

 export ROS_MASTER_URI=http://<MASTER_IP>:11311/
 export ROS_IP=<MACHINE_IP>
 export ROS_PC_NAME=<MACHINE_NAME>

For example:

 export ROS_MASTER_URI=http://192.168.100.101:11311/
 export ROS_IP=192.168.100.102
 export ROS_PC_NAME=PC1-Example

The above definitions will not be persistent across terminal sessions. To set the variables definitively, they can be added directly to the end of the .bashrc file in the home folder by typing:

 echo "export ROS_MASTER_URI=http://192.168.100.101:11311/" >> ~/.bashrc
 echo "export ROS_IP=192.168.100.102" >> ~/.bashrc
 echo "export ROS_PC_NAME=PC1-Example" >> ~/.bashrc

or:

 gedit ~/.bashrc

If gedit is used, the same variables need to be set in the bashrc file:

 ROS_MASTER_URI=http://192.168.100.101:11311/
 ROS_IP=192.168.100.102
 ROS_PC_NAME=PC1-Example

2. Create files for multi-sensor calibration.

Multi-sensor calibration is performed by running a calibration node in the master PC and a sensor driver in every PC attached to a sensor (one driver node for every sensor). The network must be configured in the open_ptrack_config/opt_calibration/conf/camera_network.yaml file.

Below is a camera_network.yaml file for a network composed of three PCs. The first has 2 Kinect v2s, the second has a Zed, and the third a RealSense:

enable_people_tracking: true
enable_pose: true
enable_object: true
# Camera network parameters
network:
  - pc: "PC1"
    sensors:
      - type: kinect2
        id: "kinect01"
        serial: "012345678901"
        people_detector: hog
      - type: kinect2
        id: "kinect02"
        serial: "012345678902"
        people_detector: hog
  - pc: "PC2"
    sensors:
      - type: zed
        id: "zed01"
        people_detector: yolo
  - pc: "PC3"
    sensors:
      - type: realsense
        id: "realsense01"
        people_detector: hog

# Checkerboard parameters
checkerboard:
  rows: 6
  cols: 5
  cell_width: 0.115
  cell_height: 0.115

N.B.: Pay particular attention to the leading spaces. Do not use Tab.

A PC is added to the network with the parameter pc: "<ROS_PC_NAME>" preceded by a minus that indicates that it belongs to a list, where the name must match the ROS_PC_NAME chosen in section #1 above.

Then, for each PC, the list of the connected sensors is added with the parameter sensors. For each sensor, three to four parameters can be defined:

  • type (mandatory) defines the type of the sensor. It must be kinect1 for the 1st Kinect version, kinect2 for the 2nd Kinect version, zed for the Stereolabs Zed, and realsense for the Intel RealSense camera.
  • id (mandatory) is the unique name to identify the sensor in the network.
  • serial (optional) defines the serial number of the imager to make multiple imagers distinguishable to the same PC. Please see also libfreenect2's requirements for multiple kinects. Omit if only one of a given imager type is connected to the machine in question.
  • people_detector (mandatory) Can be either hog for the HOG detector or yolo to use the yolo person detector. HOG is the default. Initial tests have found the yolo detector is necessary for quality tracking when using the Zed camera.

The parameters of the checkerboard used for calibration must also be added:

# Checkerboard parameters
checkerboard:
  rows: 6
  cols: 5
  cell_width: 0.12
  cell_height: 0.12

Note: The rows and cols parameters are defined by the number of chess intersections in rows and columns (cols), not the number of squares along the edge of the checkerboard. The width and height measurements are in meters. See more information here

Setting Up an OpenPTrack v2 System:

Running OpenPTrack v2:

Tracking GUI

How to receive tracking data in:

  1. Tested Hardware
  2. Network Configuration
  3. Imager Mounting and Placement
  4. Calibration in Practice
  5. Quick Start Example
  6. Imager Settings
  7. Manual Ground Plane
  8. Calibration Refinement (Person-Based)
  9. Calibration Refinement (Manual)

OPT on the NVidia Jetson

Clone this wiki locally