How to compile the move_base_app using Binary Distribution

asked 2015-06-17 07:57:10 -0600

GhostFlying gravatar image

I tried to use the Binary Distribution ndk module to run ros on Android, I compiled the sample app with the tutorial http://wiki.ros.org/android_ndk/Tutor... succefully.

But when I want to compile the move_base_app ( http://wiki.ros.org/android_ndk/Tutor... ) like the previous, I found the error:

error: undefined reference to 'move_base::MoveBase::MoveBase(tf::TransformListener&)

the source of the cpp file is below:

#include "ros/ros.h"
#include <move_base/move_base.h>

#include <android_native_app_glue.h>
#include <android/log.h>

void log(const char *msg, ...) {
    va_list args;
    va_start(args, msg);
    __android_log_vprint(ANDROID_LOG_INFO, "MOVE_BASE_NDK_EXAMPLE", msg, args);
    va_end(args);
}

void android_main(android_app *papp) {
    // Make sure glue isn't stripped
    app_dummy();

    int argc = 4;
    // TODO: don't hardcode ip addresses
    char *argv[] = {"nothing_important" , "__master:=http://192.168.1.100:11311",
                    "__ip:=192.168.1.101", "cmd_vel:=navigation_velocity_smoother/raw_cmd_vel"};

    for(int i = 0; i < argc; i++){
        log(argv[i]);
    }

    ros::init(argc, &argv[0], "move_base");

    std::string master_uri = ros::master::getURI();

    if(ros::master::check()){
        log("ROS MASTER IS UP!");
    } else {
        log("NO ROS MASTER.");
    }
    log(master_uri.c_str());

    ros::NodeHandle n;

    tf::TransformListener tf(ros::Duration(10));
    move_base::MoveBase move_base(tf);

    ros::WallRate loop_rate(100);
    while(ros::ok() && !papp->destroyRequested){
        ros::spinOnce();
        loop_rate.sleep();
    }
}

How should I do to compile the app?

edit retag flag offensive close merge delete

Comments

can you paste the full log somewhere like gist? In the last version, both examples are built together so it's weird that only the simple example is working for you.

Gary Servin gravatar image Gary Servin  ( 2015-07-01 10:14:20 -0600 )edit

did you find any solution?

Zargol gravatar image Zargol  ( 2015-12-01 08:51:19 -0600 )edit