Undefined reference error



  • Hallo,

    ich arbeite (noch immer :-)) mit ROS (Robot operating system). Jetzt will ich ein kleines Testprogramm kompilieren, aber ich bekomme immer diesen Fehler:

    /opt/ros/kinetic/include/moveit/kinematics_base/kinematics_base.h:318:115: error: ‘logError’ was not declared in this scope
     logError("moveit.kinematics_base: This kinematic solver does not support searchPositionIK with multiple poses");
    

    Erst bekam ich einen undefined reference error, dann habe ich das geforderte console_bridge so installiert: http://wiki.ros.org/console_bridge

    Und jetzt bekomme ich eben oben genannten Fehler -.- Ich hab mittlerweile schon alle header inkludiert... leider komme ich da wirklich nicht weiter.

    Danke & Lg
    buzzz



  • Schau dir mal die dazugehörige Headerdatei genau durch: Console.h.



  • thx für deine Antwort... was meinst du genau? Seh da sonst nichts besonderes...



  • Wie heißen die Macros genau?


  • Mod

    buzz_lightzyearGMX schrieb:

    thx für deine Antwort... was meinst du genau? Seh da sonst nichts besonderes...

    Es heißt offensichtlich CONSOLE_BRIDGE_logError , und so weiter. Wobei dies zugegebenermaßen ganz, ganz grauenhaft dokumentiert ist.



  • @SeppJ

    Ich verstehe nicht ganz was du meinst... ich habe die pure virtual Funktionen dieser Klasse implementiert:

    http://docs.ros.org/jade/api/moveit_core/html/classkinematics_1_1KinematicsBase.html

    Also die bool-Funktionen geben momentan nur ein "false" zurück und die anderen sind auch nur ganz rudimentär implementiert, ich will es nur mal zum kompilieren bringen.

    Dafür hab ich folgende Cpp und Hpp:

    Header:

    #ifndef IKMOVEIT_MYIK_HPP
    #define IKMOVEIT_MYIK_HPP
    
    #include <moveit/kinematics_base/kinematics_base.h>
    #include <console_bridge/console.h>
    #include <console_bridge_export.h>
    #include <ros/console.h>
    
    using namespace kinematics;
    
    class TestImpl : KinematicsBase
    {
    public:
    
        const std::vector <std::string > & getJointNames() const;
        const std::vector <std::string > & getLinkNames() const;
    
        bool getPositionFK (const std::vector< std::string > &link_names, const std::vector< double > &joint_angles, std::vector<geometry_msgs::Pose> &poses) const;
    
        bool getPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector <double> &ik_seed_state, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code,
                                   const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const;
    
        bool initialize(const std::string &robot_description, const std::string &group_name, const std::string &base_frame, const std::string &tip_frame,
                                double search_discretization);
    
        virtual bool searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector < double > &solution,
                                       moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) = 0;
    
        bool searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, const std::vector< double > &consistency_limits,
                                      std::vector < double > &solution, const IKCallbackFn &solution$_callback, moveit_msgs::MoveItErrorCodes &error_code,
                                      const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const;
    
    };
    
    #endif //IKMOVEIT_TESTIMPL_HPP
    

    Cpp:

    #include "TestImpl.hpp"
    
    using namespace kinematics;
    using std::vector;
    using std::string;
    using namespace std;
    
    const vector <string>& TestImpl::getJointNames() const
    {
        //Change ME:
        return vector<string>();
    }
    const vector <string>& TestImpl::getLinkNames() const
    {
        //Change ME:
        return vector<string>();
    }
    
    bool TestImpl::getPositionFK (const vector<string> &link_names, const vector< double > &joint_angles, vector<geometry_msgs::Pose> &poses) const
    {
        //Change ME:
        return false;
    }
    
    bool TestImpl::getPositionIK(const geometry_msgs::Pose &ik_pose, const vector <double> &ik_seed_state, vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code,
            const kinematics::KinematicsQueryOptions& options) const
    {
        cout << "in getPositionIK" << endl;
    
        //Change ME:
        return false;
    }
    
    bool TestImpl::initialize(const string &robot_description, const string &group_name, const string &base_frame, const string &tip_frame,
                            double search_discretization)
    {
        //Change ME:
        return false;
    }
    
    bool TestImpl::searchPositionIK (const geometry_msgs::Pose &ik_pose, const vector< double > &ik_seed_state, double timeout, vector < double > &solution,
                                   moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options)
    {
        //Change ME:
        return false;
    }
    
    bool TestImpl::searchPositionIK (const geometry_msgs::Pose &ik_pose, const vector< double > &ik_seed_state, double timeout, const vector< double > &consistency_limits,
                                  vector < double > &solution, const IKCallbackFn &solution$_callback, moveit_msgs::MoveItErrorCodes &error_code,
                                  const kinematics::KinematicsQueryOptions &options) const
    {
        //Change ME:
        return false;
    }
    

    Wenn ich nun ein Objekt der Klasse TestImpl erzeugen und das Programm kompilieren will, bekomme ich eben diesen Fehler:

    /opt/ros/kinetic/include/moveit/kinematics_base/kinematics_base.h:318:115: error: ‘logError’ was not declared in this scope
     logError("moveit.kinematics_base: This kinematic solver does not support searchPositionIK with multiple poses");
    

    Also die log-Funktion selbst hab ich nicht implementiert oder gar verwendet...

    Thx & Lg



  • Da scheint die kinematics_base.h auf einer anderen (bzw. älteren) <console_bridge/console.h> zu basieren, welche anscheinend noch logError, logWarn etc. verwendet hat, s. z.B. deprecated macros of console_bridge.



  • Ja, genau das wars... der Fehler ist jetzt mal weg, jetzt bin ich beim nächsten 😃 😃

    Danke für die Hilfe und Lg


Anmelden zum Antworten