Skip to content

Latest commit

 

History

History

rct_ros_tools

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

RCT ROS Tools

** THIS IS UNDER CONSTRUCTION **

Description

This package contains some basic tools for loading, saving, and collecting simple data sets for offline processing. This IS NOT CURRENTLY MEANT TO ROBUST and feature-full. I really just wanted to facilitate testing.

Loading/Saving Calibration Data Sets

I wrote some very basic tools for loading/saving robot pose & image pair data sets:

// ...

// Load the data set (and make sure it worked)
const std::string data_path = ros::package::getPath("rct_examples") + "/data/test_set_10x10/cal_data.yaml";
boost::optional<rct_ros_tools::ExtrinsicDataSet> maybe_data_set = rct_ros_tools::parseFromFile(data_path);
// Attempt to load the data set via the data record yaml file:
if (!maybe_data_set)
{
  std::cerr << "Failed to parse data set from path = " << data_path << "\n";
  return 1;
}
// Now that its loaded let's create some aliases to make this nicer
const std::vector<cv::Mat>& image_set = maybe_data_set->images;
const std::vector<Eigen::Affine3d>& wrist_poses = maybe_data_set->tool_poses;

// ...

The file pointed to, cal_data.yaml, has the following structure:

- pose: poses/0.yaml
  image: images/0.png
- pose: poses/1.yaml
  image: images/1.png
- pose: poses/2.yaml
  image: images/2.png
- pose: poses/3.yaml
  image: images/3.png
- pose: poses/4.yaml
  image: images/4.png

# ...

Each array entry is a pair of image and pose data. Note that all paths are relative to cal_data.yaml itself. Each pose file has a simple structure:

x: 0.7169496300523684
y: 0.00330346692205527
z: 0.853313460465923
qx: -0.01709391593413424
qy: 0.99974825023776
qz: -0.01437638468984423
qw: -0.002133951223335981

Data Collection Tools

There's one active tool for command line data collection of a single transform and image:

roslaunch rct_ros_tools command_line_data_collection.launch target_file:=<PATH_TO_TARGET_YAML_FILE>

See the rct_examples/config directory for target examples. Additional parameters include base_frame and tool_frame to specify robot transforms, which default to base_link and tool0 respectively. The image_topic arg can be used to control topic subscribed to: the node will publish annotated images to image_topic + _observer so you can see if the target is detected.