[Documentation] [TitleIndex] [WordIndex

Only released in EOL distros:  

ethzasl_ptam: ptam | ptam_com | rqt_ptam

Package Summary

Modified version of the monocular SLAM framework PTAM

Package Summary

Modified version of the monocular SLAM framework PTAM

  • Maintainer: Markus Achtelik <markus.achtelik AT mavt.ethz DOT ch>, Stephan Weiss <stephan.weiss AT mavt.ethz DOT ch>, Simon Lynen <simon.lynen AT mavt.ethz DOT ch>
  • Author: Markus Achtelik <markus.achtelik AT mavt.ethz DOT ch>, Stephan Weiss <stephan.weiss AT mavt.ethz DOT ch>, Simon Lynen <simon.lynen AT mavt.ethz DOT ch>
  • License: see http://www.robots.ox.ac.uk/~gk/PTAM/download.html
  • Bug / feature tracker: https://github.com/ethz-asl/ethzasl_ptam/issues
  • Source: git https://github.com/ethz-asl/ethzasl_ptam.git (branch: None)


This Package is the modified version of well known monocular SLAM framework PTAM presented by Klein & Murray in their paper at ISMAR07. We modified the original code such that:

This version of PTAM was successfully used in the European project sFly to estimate a 6DoF pose for long-term vision based navigation of a micro helicopter in large outdoor environments.

Please study the original PTAM website and the corresponding paper before using this code. Also, be aware of the license that comes with it.

Note: This package is under active development. It is meant for research use only (license) and at your own responsibility.


Modifications to the Original Code

PTAM has been ported to be compatible to the Robot Operating System (ROS) such that:

Keyframe Handling

In PTAM, the map is defined as a set of keyframes together with their observed features. In order to minimize the computational complexity, here we set a maximum number of keyframes retained in the map. If this number is exceeded, the keyframe furthest away from the current MAV pose gets deleted along with the features associated with it. If the maximum number of retained keyframes is infinite, then the algorithm is equivalent to the original PTAM, while if we set a maximum of 2 keyframes we obtain a visual odometry framework. Naturally, the larger the number of retained keyframes, the lower the estimation drift, but also the larger the computational complexity.

Improved Feature Handling for More Robust Maps

When flying outdoors, we experienced severe issues with self-similarity of the environment - e.g. the asphalt in urban areas or the grass in rural areas. Naturally, features extracted at higher pyramidal levels are more robust to scene ambiguity. Thus, while the finest-scale features are included for tracking, we omit them in map-handling - i.e. we only store features extracted in the highest 3 pyramidal levels. This improves

Thus, while the finest-scale features are included for tracking, we omit them in map-handling -- i.e. we only store features extracted in the highest 3 pyramidal levels. This improves tracking quality when moving away from a given feature (e.g. when taking-off with a MAV with a downward-looking camera), making it possible to navigate over both grass and asphalt.

Since this vision algorithm is keyframe-based, it has high measurement rates when tracking. However, at keyframe generation the frame-rate drops remarkably. Using only features detected at the highest pyramidal levels also reduces drastically the number of newly added features upon keyframe generation. This results to great speed-ups with keyframe-generation running at 13Hz (in contrast to the 7Hz of the original PTAM) and normal tracking rates of around 20Hz on an onboard Atom computer 1.6GHz.

Concerning the type of features we augmented the choice for the corner detector by the AGAST features. Compared to the FAST derivatives, the AGAST corner detector is more repetitive and usually slightly faster as described in this paper. In self-similar structures, it is crucial that the corner detector is highly repetitive. Hence we suggest here to use the AGAST corner detector instead of FAST.

Re-Initialization After Failure Mode

For automatic initialization we ensure that the baseline is sufficiently large by calculating the rotation-compensated median pixel disparity. For rotation compensation we use efficient second-order minimization techniques (ESM) in order to keep PTAM independent of IMU readings. For re-initializations, we store the median scene depth and pose of the closest keyframe and propagate this information to the new initialized map. This way we minimize large jumps in scale and pose at re-initializations.

Inverted Index Structure for Map-point Filtering

On each frame, PTAM projects the 3D points from the map into the current image according to the motion-model prior, which allows then point-correspondences to be established for tracking. Since no filtering on point visibility is preceding this step, it scales linearly with the number of points in the map. We implemented an inverted index structure based on the grouping of map points inside keyframes which allows discarding large groups of map-points with low probability of being in the field-of-view. The search for visible points is performed by re-projecting a small set of distinct map-points from every keyframe which permits inference on their visibility from the current keyframe. The total number of points that need evaluation by reprojection is thereby significantly reduced leading to a scaling of the system in linear order of the visible keyframes rather than in linear order with the overall number of keyframes in the map.


To use ETHZASL_PTAM you need an environment with sufficient contrast (i.e. texture) and light. If your shutter speed is above 5ms to obtain an image with sufficient contrast it is very likely that the algorithm does not work properly because of motion blur. This depends on vehicle's motion and vibrations. For good performance on MAVs you may ensure:

Camera Calibration

The camera model used in PTAM is made for wide angle lenses (>90°). The cameracalibrator node in this package is unchanged with respect to the original code - except the ROS compatibility. You should have a re-projection error of below 0.5. If you have problems calibrating your camera, please have a look at this page.


The manual initialization procedure is the same as on the PTAM website:

For automatic initialization, enable the AutoInit checkbox in the dynamic reconfigure GUI. This activates also the re-initialization procedure if the map is lost.

Remote Interface

The node remote_ptam catches the image and information published by PTAM such that you can visualize it on a ground station offboard your vehicle. This remote interface accepts nearly all inputs as the original PTAM GUI:

It also displays the map grid and the initialization trails but not the features in the image nor in a 3D view. See the remote_ptam node documentation for more details.

Running onboard the vehicle

Usually the robot on which PTAM runs does not have any display means and PTAM is controlled remotely using remote_ptam. In such cases the built PTAM GUI can be disabled to free additional computation resources: set the fix parameter gui=False. For further speed-up and performance boost of PTAM onboard the robot you may consider the following settings:

Map Export and Map Display in RViz

The node ptam_visualizer fetches the 3D features, keyframes and actual pose from the PTAM framework and prepares the data to be visualized in RViz. Simply start the node and RViz to start the streaming. The node also allows to store map, path and keyframe data to a file.


!! under construction !! please check regularly for updates

Node Information


main framework derived from the original PTAM

Subscribed Topics

image (sensor_msgs/Image) vslam/key_pressed (std_msgs/String) vslam/imu (sensor_msgs/Imu)

Published Topics

vslam/info (ptam_com/ptam_info) vslam/pose (geometry_msgs/PoseWithCovarianceStamped) vslam/preview (sensor_msgs/Image)


vslam/pointcloud (invalid message type for SrvLink(srv/type)) vslam/keyframes (invalid message type for SrvLink(srv/type))


Dynamically Reconfigurable Parameters
See the dynamic_reconfigure package for details on dynamically reconfigurable parameters. ~Scale (double, default: 1.0) ~MotionModelSource (str, default: CONSTANT) ~MaxPatchesPerFrame (double, default: 500.0) ~MaxKFDistWiggleMult (double, default: 3.0) ~UseKFPixelDist (bool, default: False) ~NoLevelZeroMapPoints (bool, default: False) ~EpiDepthSearchMaxRange (double, default: 100.0) ~CoarseMin (double, default: 20.0) ~CoarseMax (double, default: 60.0) ~CoarseRange (double, default: 30.0) ~CoarseSubPixIts (double, default: 8.0) ~DisableCoarse (bool, default: False) ~CoarseMinVelocity (double, default: 0.006) ~TrackingQualityGood (double, default: 0.3) ~TrackingQualityLost (double, default: 0.13) ~TrackingQualityFoundPixels (int, default: 100) ~MaxIterations (double, default: 20.0) ~MaxKF (int, default: 0) ~BundleMethod (str, default: LOCAL_GLOBAL) ~UpdateSquaredConvergenceLimit (double, default: 1e-06) ~BundleDebugMessages (bool, default: False) ~FASTMethod (str, default: FAST9_nonmax) ~Thres_lvl0 (int, default: 10) ~Thres_lvl1 (int, default: 15) ~Thres_lvl2 (int, default: 15) ~Thres_lvl3 (int, default: 10) ~AdaptiveThrs (bool, default: False) ~AdaptiveThrsMult (double, default: 5.0) ~RotationEstimatorBlur (double, default: 0.75) ~UseRotationEstimator (bool, default: True) ~MiniPatchMaxSSD (int, default: 100000) ~PlaneAlignerRansacs (int, default: 100) ~RelocMaxScore (int, default: 9000000) ~AutoInit (bool, default: False) ~AutoInitPixel (int, default: 20) ~MaxStereoInitLoops (int, default: 10)
Static parameters
parameters that are statically set ~InitLevel (, default: 1) ~gui (, default: true) ~ImageSizeX (, default: 752) ~ImageSizeY (, default: 480) ~ARBuffer_width (, default: 1200) ~ARBuffer_height (, default: 960) ~WiggleScale (, default: 0.1) ~BundleMEstimator (, default: Tukey) ~TrackerMEstimator (, default: Tukey) ~MinTukeySigma (, default: 0.4) ~CandidateMinSTScore (, default: 70) ~Cam_fx (, default: --) ~Cam_fy (, default: --) ~Cam_cx (, default: --) ~Cam_cy (, default: --) ~Cam_s (, default: --) ~Calibrator_BlurSigma (, default: 1.0) ~Calibrator_MeanGate (, default: 10) ~Calibrator_MinCornersForGrabbedImage (, default: 20) ~Calibrator_Optimize (, default: 0) ~Calibrator_Show (, default: 0) ~Calibrator_NoDistortion (, default: 0) ~CameraCalibrator_MaxStepDistFraction (, default: 0.3) ~CameraCalibrator_CornerPatchSize (, default: 20) ~GLWindowMenu_Enable (, default: true) ~GLWindowMenu_mgvnMenuItemWidth (, default: 90) ~GLWindowMenu_mgvnMenuTextOffset (, default: 20)

2020-02-15 13:02