Giter VIP home page Giter VIP logo

robot_cal_tools's Introduction

Robot Calibration Tools

Static Camera Workcell Setup

Platform CI Status
Ubuntu (Focal) Build Status
Lint (Clang-Format) Build Status
Lint (CMake-Format) Build Status

Description

A loosely connected bundle of tools for calibrating cameras to (industrial) robots and vice-versa with a focus on being easy to integrate into more complex applications.

This work is based on the work of Dr. Chris Lewis @drchrislewis (see industrial_calibration) and modifications made by Geoffrey Chiou in IC2.

The focus and philosophy of this library is provide to provide a suite of stand-alone "optimization functions" that take as input structure full of well-documented arguments and produce an answer that is your calibration. How you collect data and what you do with the answer is left to you.

Installation

This library is meant to be used within the ROS ecosystem, but the core optimizations depends on only Ceres-Solver and its dependencies. Follow the link for instructions to install Ceres. Afterwards, clone this package into your workspace and build with catkin.

Other support libraries use additional tools:

  • The built-in "target finder" in rct_image_tools uses OpenCV.
  • The data collection helpers in rct_ros_tools uses TF and various image transport mechanisms.

Quick-Start

  1. Please read the calibration primer for a description of terminology and conventions used in this library.
  2. Please visit the documentation for the calibration you wish to solve in rct_optimizations. See below for a discussion of supported problems.
  3. If you need to do intrinsic calibration of your sensor, then please use ROS' built in method from here. Alternatively, use OpenCV's calibrateCamera function on which the ROS utility is built.
  4. After setting up your "experiment", perform any necessary data collection: moving robots, taking images, etc. Be sure to get a good diversity of images; skew is important!
  5. Create an instance of your problem's Problem data structure and fill it out.
  6. Call rct_optimizations::optimize(Problem&) and get a Result back.
  7. Check that the result converged and then apply it to your workcell: either manually modify the URDF, publish the TF frame, etc. Consider using something like (shameless plug) mutable transform publisher.

Outline

  • rct_optimizations: Contains core libraries for performing the "math" of optimizations, usually using Ceres. This is where you'll find your library calls.
  • rct_image_tools: Builds on OpenCV to provide tools for finding targets in images. This lets you extract "correspondences" easily for supported target types.
  • rct_examples: This package contains both simple examples and offline processing tools for a variety of common calibrations. Look here for experimental setups and examples.
  • rct_ros_tools: (Experimental) Provides some "helper tools" for data collection and loading of data through ROS parameters/YAML files.

Calibrations

See the readme of rct_examples for more information on the most popular and tested calibrations. There's even some nice pictures.

Currently supported calibrations:

  • Extrinsic calibration of a 2D camera on robot wrist
  • Extrinsic calibration of a 3D camera on robot wrist
  • Extrinsic calibration of one or more static cameras in the workcell

Semi-Experimental (these have testing or robustness that needs to be improved):

  • Solve PnP for one or more cameras
  • Intrinsic calibration

The source code for these calibrations can be found in rct_optimizations.

Example Code

For example, see rct_example's camera-on-wrist calibration.

Development Plan

  1. Replicate the OpenCV intrinsic calibration
  2. Implement Qt GUI based on IC2 to speed calibration process in simple scenarios.
  3. Provide examples of qualifiying the accuracy of a calibrated system
  4. Investigate robot kinematic calibration (ala Mike Ferguson' package)
  5. Provide tools explicitly for robot tool calibration (for the moment, please see my super simple one at tool_point_calibration

robot_cal_tools's People

Contributors

cedrusx avatar colin-lewis-19 avatar drchrislewis avatar jdlangs avatar jmeyer1292 avatar jrgnicho avatar levi-armstrong avatar marip8 avatar marrts avatar schornakj avatar smith-doug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robot_cal_tools's Issues

Split into ROS and non-ROS repositories?

I've been using robot_cal_tools with ROS2, and I would like to contribute back some of the work I did in my weird fork to enable this without adversely affecting ROS1 projects that use this repo. Since some of the RCT packages contain ROS nodes, I think we will need to reorganize the structure of this repo.

A reasonable initial approach could be:

  • Make rct_optimizations and rct_image_tools pure CMake packages.
  • Move rct_ros_tools and rct_examples to a new repository with parallel branches for ROS1 and ROS2.

I recall that one of the goals of this project is to integrate it with the industrial_calibration project, with robot_cal_tools providing the underlying optimization libraries and industrial_calibration providing ROS nodes. I think restructuring this repo a little bit will actually help with that integration process down the road.

Advice on calibration

Hi guys,

With the great help from Chris I managed to get a calibration using static_camera_example.launch / static_camera_extrinsic.cpp setup in examples. I am conscious of taking up too much of Chris's time so hopefully some one can point me in the right direction on this problem I am having

Now the problem I am facing is the following

  • I can get an OK calibration (+/- 10mm in most of the axes & < 3px per dot) when I use images & poses which are not that skewed

  • When I introduce images and poses that are very skewed / angled the whole calibration returns nothing meaningful and the re projection is way way out (200+px per dot). when I remove the skewed images and poses they resemble what I would expect to get back albeit not that accurate

So a few questions

  • Has anyone done a calibration with this example?

  • Any ideas what could be wrong. Why does introducing angled imaged and poses into the same code produce such bad results? (it should make it better)

Just some notes

  • I've attached an example of what I mean by a skewed image and non skewed image toward the bottom of this post

  • I've checked all the images and all the correspondences are being collected properly

  • I redid the intrinsic calibration again and I'm pretty happy with the numbers I am getting

  • The initial guesses seems correct and the run on the less skewed images and poses would seem to back this up

  • i debugged the calibration code and everything seems fine code wise although it's a black box once it get the the ceres problem solving part

  • I've been very careful in making sure the pose and images are aligned so I don't believe it's that sort of an issue

Any help with this would be greatly appreciated

Thanks
JT

Non skew - these type of images and poses work although the calibration is not the most accurate
image

Skewed - these type are really throwing the calibration off
image

Multi Static Camera Yaml

Should I change the Yaml such that the camera data is a vector instead of having the pass the number of cameras?

Fresh clone doesn't compile due to missing GTest

When you clone the repo down and attempt to build as a catkin workspace, rct_ros_tools fails to build due to the local copy/build of GTest not being present. I was able to figure out I could build with RCT_BUILD_TESTS to get it working but that shouldn't be needed when starting with the repo.

undefined reference to `YAML::Node::~Node()'

Hi,

during compilation of the current master branch using catkin build -DCMAKE_BUILD_TYPE=Release command, I am getting following error:

Errors     << rct_ros_tools:make /home/ilya/ros/workspaces/callibration_ws/logs/rct_ros_tools/build.make.001.log                                                                                          
/usr/bin/ld: CMakeFiles/rct_ros_tools_cmd.dir/src/command_line_cal.cpp.o: in function `main.cold':
command_line_cal.cpp:(.text.unlikely+0x207): undefined reference to `YAML::Node::~Node()'
/usr/bin/ld: CMakeFiles/rct_ros_tools_cmd.dir/src/command_line_cal.cpp.o: in function `main':
command_line_cal.cpp:(.text.startup+0xee0): undefined reference to `YAML::Node::~Node()'
collect2: error: ld returned 1 exit status

To fix this issue, I have replaced in the file rct_ros_tools/include/rct_ros_tools/loader_utils.h the following line

yaml-cpp/node/node.h

with

yaml-cpp/yaml.h

Can you please check and correct the issue ?

modify camera_on_wrist.cpp for external static camera setup

Hi guys,

Just trying this code out (thanks for all the good work)

If I was to take the example "camera_on_wrist.cpp" and modify it so that it worked for a static external camera setup what are the main change I would have to make to get a standalone application working. I'm assuming it's the following

1: Take a set of images from multiple angles with a calibration grid where it is attached to the robot end effector tool
2: Record the base pose for each of the images taken (What format should these be in is (x,y,z, rx, ry,rz) acceptable?
3: Define a problem
4: Add guesses to the problems - not sure on this part - can they be very broad?
5: Import intrinsics
6: Do I need to change anything else in this example file - how does it know its an static camera in the cell vs on the robot (or does it market with regards the maths?

Thanks in advance

Utility Functions to Examples

#16 Merged a bunch of changes to reduce duplications in the rct_examples/tools directory. Among these changes were a lot of new utility functions for printing and drawing images, which is fine, but they were added to "core" packages. I want to keep the APIs of rct_ros_tools and rct_image_tools as clean as possible.

So, in summary, all of these utility functions need to be migrated to rct_examples.

Possible bug in image projection

I came across a possible bug while developing a simulated observation generator in which the 2D calibration algorithms do not check whether the z value of the target point, projected into the camera frame, is greater than zero (i.e. actually in front of the camera). See this file for reference.

The issue here is:

  • User provides a bad initial guess for the target or camera position (probably on accident)
  • Some target observations show up behind the camera due to the bad guess
  • The image projection math is no longer meaningful
  • The optimization does not converge

I suggest we check that the z-value of the 3D target point in camera coordinates is greater than zero and throw an exception indicating that the initial transform guess was probably incorrect. I think this would be more helpful than the calibration silently failing to converge

@schornakj @drchrislewis is this a reasonable interpretation of this issue?

Common Exception Class

Add a common specialized exception class to rct_common and make other RCT-specific exceptinos inherit from it. This way we can easily catch any RCT-specific exception

Calibration Naming

We're getting a lot of individual calibrations, so I want to cleanup the rct_optimizations naming scheme:

  • This is mostly TBD
  • I'm thinking maybe subfolders (in the includes, and namespaces in the source) that indicate this function is intrinsic, extrinsic, etc.
  • Add a readme that breaks down, in one sentence structures, what each calibration function does.

Merge Calibrations

extrinsic_multi_static_camera.h and extrinsic_multi_static_camera_wrist_only.h should be merged into one. We should add a boolean parameter to the problem struct and dispatch to the appropriate cost function under the hood.

Add a LICENSE file

Hi, this is really great work. We tried out with many calibration tools when we were calibrating our multi-sensor robot for the OpenLORIS-Scene dataset, and found this package the best for mocap-camera calibration in terms of both accuracy and ease of use. Thank you!

I noticed that you choose the Apache 2.0 license for all components as stated in their package.xml, which is great. How about adding a LICENSE file (e.g. copy from here) into the root folder of the repo to make it clearer for users who care about license and more friendly for automatic IP scan tools?

cannot launch node of type RCT ROS TOOL

Hello I'm doing a robotics project, and I'm trying to use your package for the calibration of my fanuc robot. Everything works except the part with the nodes, I still have the same problem (cannot launch node of type...). I thank you in advance

Todos

  • Add pictures to the rct_examples readme
  • Increase the robustness and visibility of the rct_examples for offline data processing. Make them roslaunch files that take well described yaml files with lots of pose info.
  • In the example calibrations, print out the results in URDF xyz, rpy format
  • Schedule a review.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.