ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Why doesn't the karto package build?

asked 2011-12-16 02:25:28 -0500

Hozefa Indorewala gravatar image

Hello all,

I checked out the karto package and built it initially using rosmake but the node wasn't built. After going through the CMakeLists.txt, I found out that the lines to build the node were commented out and un-commenting and building the package again led me to errors.

I was wondering if this package is still maintained. I am using running ros-electric on my machine. Thank you in advance for your help.

Cheers, Hozefa

edit retag flag offensive close merge delete

Comments

The karto node generation from the cpp source code is commented in the CMakeLists.txt because the code related with the TF API is broken. See the patch I've attatched below.

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2013-02-05 06:18:23 -0500 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2012-02-24 04:38:51 -0500

FabricioFC gravatar image

updated 2012-02-24 04:40:08 -0500

I managed to compile 36074 revision.

cmake complained about the ROS_PACKAGE_PATH variable, to solve this:

export ROS_PACKAGE_PATH=/path/to/your/karto/checkout:$ROS_PACKAGE_PATH

After this:

cmake -G "Unix Makefiles" .
make

Salutations

edit flag offensive delete link more
1

answered 2013-02-05 05:23:49 -0500

updated 2013-02-05 06:16:58 -0500

The proposed solutions are not enough to solve the problem on the current HEAD revision. Several things are still broken. Here I provide a patch over the revision r40357 to make the karto package work again on fuerte. Enjoy!

Changes:

  • fixed dependencies with boost, eigen and sba in the CMakeLists.txt and manifest.xml
  • fixed some broken code related with tf (probably related with API changes)
  • fixed stage demo config file (deprecated syntax laser to ranger)
Index: manifest.xml
===================================================================
--- manifest.xml    (revision 40357)
+++ manifest.xml    (working copy)
@@ -16,6 +16,7 @@
   <depend package="rosconsole"/>
   <depend package="nav_msgs"/>
   <depend package="message_filters"/>
+  <depend package="sba"/>

   <export>
     <cpp cflags="-I${prefix}/karto/include" lflags="-Wl,-rpath,${prefix}/karto/lib -L${prefix}/karto/lib -lOpenKarto"/>
Index: src/slam_karto.cpp
===================================================================
--- src/slam_karto.cpp  (revision 40357)
+++ src/slam_karto.cpp  (working copy)
@@ -218,7 +218,7 @@

     // Get the laser's pose, relative to base.
     tf::Stamped<tf::pose> ident;
-    tf::Stamped<bttransform> laser_pose;
+    tf::Stamped<tf::pose> laser_pose;
     ident.setIdentity();
     ident.frame_id_ = scan->header.frame_id;
     ident.stamp_ = scan->header.stamp;
@@ -298,9 +298,9 @@
 SlamKarto::getOdomPose(karto::Pose2& karto_pose, const ros::Time& t)
 {
   // Get the robot's pose
-  tf::Stamped<tf::pose> ident (btTransform(tf::createQuaternionFromRPY(0,0,0),
-                                           btVector3(0,0,0)), t, base_frame_);
-  tf::Stamped<bttransform> odom_pose;
+  tf::Stamped<tf::transform> ident (tf::Transform(tf::createQuaternionFromRPY(0,0,0),
+                                           tf::Vector3(0,0,0)), t, base_frame_);
+  tf::Stamped<tf::transform> odom_pose;
   try
   {
     tf_.transformPose(odom_frame_, ident, odom_pose);
@@ -563,8 +563,8 @@
     tf::Stamped<tf::pose> odom_to_map;
     try
     {
-      tf_.transformPose(odom_frame_,tf::Stamped<tf::pose> (btTransform(tf::createQuaternionFromRPY(0, 0, corrected_pose.GetHeading()),
-                                                                    btVector3(corrected_pose.GetX(), corrected_pose.GetY(), 0.0)).inverse(),
+      tf_.transformPose(odom_frame_,tf::Stamped<tf::pose> (tf::Transform(tf::createQuaternionFromRPY(0, 0, corrected_pose.GetHeading()),
+                                                                    tf::Vector3(corrected_pose.GetX(), corrected_pose.GetY(), 0.0)).inverse(),
                                                                     scan->header.stamp, base_frame_),odom_to_map);
     }
     catch(tf::TransformException e)
Index: worlds/willow-pr2-5cm.world
===================================================================
--- worlds/willow-pr2-5cm.world (revision 40357)
+++ worlds/willow-pr2-5cm.world (working copy)
@@ -4,7 +4,7 @@
   gui_nose 0
 )

-define topurg laser
+define topurg ranger
 (

   range_max 30.0
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt  (revision 40357)
+++ CMakeLists.txt  (working copy)
@@ -11,8 +11,14 @@
   message(FATAL_ERROR "Build of Karto failed")
 endif(_make_failed)

+find_package(Eigen)
+include_directories(${EIGEN_INCLUDE_DIRS})
+add_definitions(${EIGEN_DEFINITIONS})
+
+
 # Build the ROS wrapper
 include_directories(${PROJECT_SOURCE_DIR}/karto/include)
 link_directories(${PROJECT_SOURCE_DIR}/karto/lib)
-# rosbuild_add_executable(bin/slam_karto src/slam_karto.cpp src/spa_solver.cpp)
-# target_link_libraries(bin/slam_karto OpenKarto)
+rosbuild_add_executable(bin/slam_karto src/slam_karto.cpp src/spa_solver.cpp)
+target_link_libraries(bin/slam_karto OpenKarto)
+rosbuild_link_boost(bin/slam_karto signals)
edit flag offensive delete link more
1

answered 2012-02-24 02:14:33 -0500

FabricioFC gravatar image

I was getting the same issue and this happens because the cmakelist is messed up, try to get another version of commit.

And the tutorial is wrong, there is no need of these \ in "cmake -G \"Unix Makefiles\" .."

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-12-16 02:25:28 -0500

Seen: 1,343 times

Last updated: Feb 05 '13