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