error when running executable file on UWSim
The example code is including three files which are header file, member function file and main file. And the code is copied from the textbook.
I put the header file on the path:/home/gupta/catkin_ws_2/src/underwater_simulation/uwsim/include/uwsim.
I put the member function file on the path /home/gupta/catkin_ws_2/src/underwater_simulation/uwsim/src.
I put the main file on the path: /home/gupta/catkin_ws_2/src/underwater_simulation/underwater_vehicle_dynamics/src
Then I add something in the CMakeList.txt:
add_executable(mainstudent /home/gupta/catkin_ws_2/src/underwater_simulation/underwater_vehicle_dynamics
/src/mainstudent.cpp)
target_link_libraries(mainstudent uwsim ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${BULLET_LIBRARIES})
add_library(uwsim
...
src/student.cpp
...
)
header file:
class Student
{
public:
void display();
private:
int num;
char name[20];
char sex;
};
function member file:
#include <iostream>
#include "uwsim/student.h"
using namespace std;
void Student::display()
{
cout<<"num="<<num<<endl;
cout<<"name="<<name<<endl;
cout<<"sex="<<sex<<endl;
}
main file:
#include <iostream>
#include "uwsim/student.h"
int main()
{
Student stud;
stud.display();
return 0;
}
There is no error when compiling the code. However, there is error when running the executable file on the terminal. And the error is shown below:
Loading SimulatedDevices plugin: 'DredgeTool_Factory'
Loading SimulatedDevices plugin: 'ForceSensor_Factory'
Loading SimulatedDevices plugin: 'SimDev_Echo_Factory'
terminate called after throwing an instance of 'pluginlib::LibraryUnloadException'
what(): According to the loaded plugin descriptions the class ForceSensor_Factory with base class type uwsim::SimulatedDeviceFactory does not exist. Declared types are `enter code here`DredgeTool_Factory ForceSensor_Factory SimDev_Echo_Factory
Aborted (core dumped)
Any suggestion? Thanks so much.
Please format your question properly: use the Preformatted Text button (with
101010
on it) for all code and console copy/pastes. Right now it's unreadable.