Pregunta

I'm trying to create some example nodes that execute linear algebra commands. I wanted to try the TooN library (http://www.edwardrosten.com/cvd/toon.html). I was trying to follow what the package tum_ardrone has done in regards to this.

1) I downloaded the folder containing the TooN library files and moved it to the the directory /thirdparty/TooN/include/.

2) I added the following to my CMakeLists.txt file:

# set required libs and headers
include_directories( ${PROJECT_SOURCE_DIR}/thirdparty/TooN/include )  

Based on the file HelperFunctions.h located in /tum_ardrone/src I created a simple program to perform basic matrix operations. I will be using these functions later and since I'm not familiar with any library like this one I need to start from the basics. When I execute rosmake I get the following error:

 /home/pedro/fuerte_workspace/sandbox/controlador_ardrone/src/ejemploalgebralineal.cpp: In member function ‘void LinearAlgebra::InverseMatrix()’:
  /home/pedro/fuerte_workspace/sandbox/controlador_ardrone/src/ejemploalgebralineal.cpp:31:31: error: ‘struct TooN::Matrix<3>’ has no member named ‘inverse’

Here is the code I'm trying to compile:

#include <ros/ros.h>
#include <std_msgs/Empty.h>
#include <geometry_msgs/Twist.h>
#include <math.h>
#include <TooN/TooN.h>
#include <TooN/so3.h>

  using namespace std;
  using namespace TooN;

  struct LinearAlgebra
  {
    ros::NodeHandle n;

    void InverseMatrix(){
        TooN::Matrix<3,3> mat;
        mat = Data(1,2,3,4,5,6,7,8,9);
        TooN::SO3<> res = mat.inverse();
        std::cout << "m3_4\n" << mat << "\nm3_5\n"<<res  << std::endl;
    }

    void Commands(){
        InverseMatrix();
    }
  };

////////////

int main(int argc, char **argv)
{
  ros::init(argc,argv,"Linear_Algebra_ROS");

  LinearAlgebra linearalgebra;
  ros::Duration wait_time = ros::Duration(3,0);

  while(linearalgebra.n.ok()) {
      wait_time.sleep();
      linearalgebra.Commands();
      ros::spinOnce();
  }
  return 0;

Does anybody have experience with this library and/or other libraries that I can use? Any help is appreciated. I am using ROS Fuerte on Ubuntu 12.04.

¿Fue útil?

Solución

I would suggest http://eigen.tuxfamily.org for handling of Transformations and linear Algebra. It is also used by ROS related projects like PCL.

regards

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top