0
$\begingroup$

Rosanswers logo

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


Originally posted by Hozefa Indorewala on ROS Answers with karma: 28 on 2011-12-16

Post score: 0


Original comments

Comment by Pablo Iñigo Blasco on 2013-02-05:
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.

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

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


Originally posted by FabricioFC with karma: 36 on 2012-02-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

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" .."


Originally posted by FabricioFC with karma: 36 on 2012-02-24

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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 @@
   
   
   
+  
 
   
     
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 ident;
-    tf::Stamped laser_pose;
+    tf::Stamped 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 ident (btTransform(tf::createQuaternionFromRPY(0,0,0),
-                                           btVector3(0,0,0)), t, base_frame_);
-  tf::Stamped odom_pose;
+  tf::Stamped ident (tf::Transform(tf::createQuaternionFromRPY(0,0,0),
+                                           tf::Vector3(0,0,0)), t, base_frame_);
+  tf::Stamped odom_pose;
   try
   {
     tf_.transformPose(odom_frame_, ident, odom_pose);
@@ -563,8 +563,8 @@
     tf::Stamped odom_to_map;
     try
     {
-      tf_.transformPose(odom_frame_,tf::Stamped (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::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)

Originally posted by Pablo Iñigo Blasco with karma: 2982 on 2013-02-05

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.