Skip to content

With ROS2 a 2 is missing in the called lib name #1

@torydebra

Description

@torydebra

The problem I have here is that with ROS2, the robot interface fails to load the librobotinterface2, since it looks for librobotinterface2_ros.so, while the library is called librobotinterface2_ros2.so (so Cartesio run in the "visual_only" mode)

For now I have solved with std::string robot_type = "ros2"; which I imagine would cause the dual problem with ROS1.

std::string robot_type = "ros";
opt.get_parameter("robot_type", robot_type);
bool ignore_type_from_env = false;
opt.get_parameter("ignore_type_from_env", ignore_type_from_env);
const char * robot_type_env = getenv("XBOT2IFC_ROBOT_TYPE");
if(robot_type_env && !ignore_type_from_env)
{
robot_type = robot_type_env;
}
auto rob = CallFunction<RobotInterface*>(
"librobotinterface2_" + robot_type + ".so",
"xbot2_create_robot_plugin_" + robot_type,
std::move(mdl)
);

I do not know which is the exact intention, and if an external arg is necessary, since in the ros2 folder the cpp/hpp are called robotinterface2_ros (without the 2 suffix), but then in the cmake the name is robotinterface2_ros2

@alaurenzi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions