krishauser / Klampt

Kris' Locomotion and Manipulation Planning Toolkit
BSD 3-Clause "New" or "Revised" License
359 stars 91 forks source link

RobotTest, could not open file [.log4cxx.xml], can't load geometry #190

Open noke-cmu opened 1 month ago

noke-cmu commented 1 month ago

I'm not sure why, but my URDF is unable to load in my STL files as meshes. I am also getting an error for log4cxx. My URDF: <?xml version="1.0" ?>

transmission_interface/SimpleTransmission hardware_interface/EffortJointInterface hardware_interface/EffortJointInterface 1 /mugatu 0.5 0.16 false Gazebo/Green 0.1 0.1 0.5 0.16 false Gazebo/Purple 0.1 0.1 Error: klampt_env) naomio@naomio-Alienware-Aurora-R16:~$ /opt/klampt-0.9.1/bin/RobotTest /home/naomio/mugatu/mugatu_description/urdf/mugatu.urdf WorldModel::LoadRobot: /home/naomio/mugatu/mugatu_description/urdf/mugatu.urdf Joint [dummy_joint] missing origin tag under parent describing transform from Parent Link to Joint Frame, (using Identity transform). Joint [rightfootmass_joint] missing origin tag under parent describing transform from Parent Link to Joint Frame, (using Identity transform). Joint [leftfootmass_joint] missing origin tag under parent describing transform from Parent Link to Joint Frame, (using Identity transform). log4cxx: Could not open file [./log4cxx.xml]. KrisLibrary::logger(): URDFParser configured as default URDFParser: Link size: 10 URDFParser: Joint size: 5 URDFParser: Could not load geometry /home/naomio/mugatu/mugatu_description/urdf//../../mugatu/meshes/left_leg.STL, in relative or absolute paths URDFParser: Temporarily ignoring error... URDFParser: Could not load geometry /home/naomio/mugatu/mugatu_description/urdf//../../mugatu/meshes/right_leg.STL, in relative or absolute paths URDFParser: Temporarily ignoring error... URDFParser: Done loading robot file /home/naomio/mugatu/mugatu_description/urdf/mugatu.urdf BACKEND LOADED
krishauser commented 1 month ago

The log4cxx printout is a warning message saying it will configure the logger as normal.

As for the relative paths, are you using the recommended tag as in this tutorial? It should look like this (note that the root is not "/../..")

<klampt package_root="../.." flip_yz="1" use_vis_geom="1" />

noke-cmu commented 1 month ago

yes, I'm currently using it like this:

krishauser commented 1 month ago

If you can upload a minimal example URDF and STL files, I can help debug the issue.On Jun 18, 2024, at 11:18 AM, noke-cmu @.***> wrote: yes, I'm currently using it like this:

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

noke-cmu commented 4 weeks ago

I've attached my URDF and world file. I have a walking robot that uses an open loop sine wave to control the walking at a motor in the hip joint (where the two legs meet). When I run SimTest, the robot immediately skids and falls over, without any calibration or controller present. Is it possible to direct the robot's motion using a simple controller rather than a defined path/trajectory? I'm trying to implement a controller, but I'm running into some issues. I've attached my controller files as well. mugatu_klamptdescription.txt Errors when building MyPIDController.txt

krishauser commented 4 weeks ago

As for the build error, you may need to use Klampt::RobotController or declare "using Klampt" at the top of your file.

I am not sure why it's not loading the right file but you can try using the absolute path "/PATH/TO/FOLDER" for the package root. Does that fix the problem?

noke-cmu commented 3 weeks ago

I am using Klampt namespace (I've updated the MyPIDController.h header file in the mugatu_klamptdescription.txt: mugatu_klamptdescription.txt ), but I'm still getting the error when I try to build the controller where it says the format is wrong:

[ 50%] Building CXX object CMakeFiles/MyPIDControllerSim.dir/main.cpp.o In file included from /home/naomio/mugatu/control/MyPIDController/main.cpp:1: /home/naomio/mugatu/control/MyPIDController/MyPIDController.h:15:26: error: expected ‘)’ before ‘&’ token 15 | MyPIDController(Robot& robot, int jointIndex) : RobotController(robot), jointIndex(jointIndex) { | ~ ^ | ) /home/naomio/mugatu/control/MyPIDController/MyPIDController.h: In member function ‘virtual void Klampt::MyPIDController::Update(Math::Real)’: /home/naomio/mugatu/control/MyPIDController/MyPIDController.h:57:50: error: no matching function for call to ‘Klampt::MyPIDController::SetPIDCommand(int&, Math::Real&)’ 57 | SetPIDCommand(jointIndex, positionCommand); | ^ In file included from /home/naomio/mugatu/control/MyPIDController/MyPIDController.h:7, from /home/naomio/mugatu/control/MyPIDController/main.cpp:1: /opt/klampt-0.9.1/include/Klampt/Control/Controller.h:49:8: note: candidate: ‘void Klampt::RobotController::SetPIDCommand(const Config&)’ 49 | void SetPIDCommand(const Config& qdes); | ^~~~~ /opt/klampt-0.9.1/include/Klampt/Control/Controller.h:49:8: note: candidate expects 1 argument, 2 provided /opt/klampt-0.9.1/include/Klampt/Control/Controller.h:50:8: note: candidate: ‘void Klampt::RobotController::SetPIDCommand(const Config&, const Config&)’ 50 | void SetPIDCommand(const Config& qdes,const Config& dqdes); | ^~~~~ /opt/klampt-0.9.1/include/Klampt/Control/Controller.h:50:36: note: no known conversion for argument 1 from ‘int’ to ‘const Config&’ {aka ‘const Math::VectorTemplate&’} 50 | void SetPIDCommand(const Config& qdes,const Config& dqdes); | ~~~~^~ /home/naomio/mugatu/control/MyPIDController/main.cpp: In function ‘int main(int, const char)’: /home/naomio/mugatu/control/MyPIDController/main.cpp:12:3: error: ‘GLUISimTestGUI’ was not declared in this scope 12 | GLUISimTestGUI gui(&backend,&world); | ^~~~~~ /home/naomio/mugatu/control/MyPIDController/main.cpp:13:3: error: ‘gui’ was not declared in this scope 13 | gui.SetWindowTitle("SimTest"); | ^~~ /home/naomio/mugatu/control/MyPIDController/main.cpp:14:81: error: no matching function for call to ‘Klampt::MyPIDController::MyPIDController(std::shared_ptr_access<Klampt::RobotModel, gnu_cxx::_S_atomic, false, false>::element_type&)’ 14 | RobotControllerFactory::RegisterDefault(new MyPIDController((world.robots[0]))); | ^ In file included from /home/naomio/mugatu/control/MyPIDController/main.cpp:1: /home/naomio/mugatu/control/MyPIDController/MyPIDController.h:13:7: note: candidate: ‘constexpr Klampt::MyPIDController::MyPIDController(const Klampt::MyPIDController&)’ 13 | class MyPIDController : public RobotController{ | ^~~~~~~ /home/naomio/mugatu/control/MyPIDController/MyPIDController.h:13:7: note: no known conversion for argument 1 from ‘std::shared_ptr_access<Klampt::RobotModel, gnu_cxx::_S_atomic, false, false>::element_type’ {aka ‘Klampt::RobotModel’} to ‘const Klampt::MyPIDController&’ make[2]: [CMakeFiles/MyPIDControllerSim.dir/build.make:63: CMakeFiles/MyPIDControllerSim.dir/main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:76: CMakeFiles/MyPIDControllerSim.dir/all] Error 2 make: [Makefile:84: all] Error 2

noke-cmu commented 3 weeks ago

has anyone else gotten an error like this while trying to build a custom controller: naomio@naomio-Alienware-Aurora-R16:~/mugatu/control/MugatuController/build$ cmake --build . Scanning dependencies of target MugatuSim [ 11%] Building CXX object CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/qsimtestgui.cpp.o [ 22%] Linking CXX executable MugatuSim /usr/bin/ld: /usr/local/lib/libKrisLibrary.a(fileutils.cpp.o): in function FileUtils::TempName(char*, char const*, char const*)': fileutils.cpp:(.text+0x2cf): warning: the use oftempnam' is dangerous, better use mkstemp' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/qsimtestgui.cpp.o: in functionQSimTestGUI::QSimTestGUI(QKlamptDisplay, Klampt::SimTestBackend)': qsimtestgui.cpp:(.text+0x79): undefined reference to vtable for QSimTestGUI' /usr/bin/ld: qsimtestgui.cpp:(.text+0x8e): undefined reference tovtable for QSimTestGUI' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/qsimtestgui.cpp.o: in function QSimTestGUI::~QSimTestGUI()': qsimtestgui.cpp:(.text+0x9d5): undefined reference tovtable for QSimTestGUI' /usr/bin/ld: qsimtestgui.cpp:(.text+0x9e7): undefined reference to vtable for QSimTestGUI' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/KlamptQt/qklamptguibase.cpp.o: in functionQKlamptGUIBase::QKlamptGUIBase(QKlamptDisplay, Klampt::GenericBackendBase)': qklamptguibase.cpp:(.text+0x3e): undefined reference to vtable for QKlamptGUIBase' /usr/bin/ld: qklamptguibase.cpp:(.text+0x50): undefined reference tovtable for QKlamptGUIBase' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/KlamptQt/qklamptguibase.cpp.o: in function QKlamptGUIBase::~QKlamptGUIBase()': qklamptguibase.cpp:(.text+0x4d9): undefined reference tovtable for QKlamptGUIBase' /usr/bin/ld: qklamptguibase.cpp:(.text+0x4eb): undefined reference to vtable for QKlamptGUIBase' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/KlamptQt/qtguibase.cpp.o: in functionQtGUIBase::QtGUIBase(Klampt::GenericBackendBase)': qtguibase.cpp:(.text+0x40): undefined reference to vtable for QtGUIBase' /usr/bin/ld: qtguibase.cpp:(.text+0x52): undefined reference tovtable for QtGUIBase' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/KlamptQt/qtguibase.cpp.o: in function QtGUIBase::~QtGUIBase()': qtguibase.cpp:(.text+0x9f): undefined reference tovtable for QtGUIBase' /usr/bin/ld: qtguibase.cpp:(.text+0xb1): undefined reference to vtable for QtGUIBase' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/driveredit.cpp.o: in functionDriverEdit::DriverEdit(Klampt::WorldModel, Klampt::Simulator, QWidget)': driveredit.cpp:(.text+0x58): undefined reference to vtable for DriverEdit' /usr/bin/ld: driveredit.cpp:(.text+0x6a): undefined reference tovtable for DriverEdit' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/driveredit.cpp.o: in function DriverEdit::~DriverEdit()': driveredit.cpp:(.text+0x22f): undefined reference tovtable for DriverEdit' /usr/bin/ld: driveredit.cpp:(.text+0x241): undefined reference to vtable for DriverEdit' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/driveredit.cpp.o: in functionDriverEdit::SendDriverValue()': driveredit.cpp:(.text+0xf6d): undefined reference to DriverEdit::SetDriverValue(int, float)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/driveredit.cpp.o: in functionDriverEdit::SaveSettings()': driveredit.cpp:(.text+0x1c66): undefined reference to toStdString[abi:cxx11](QString const&)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::LogOptions(QWidget)': logoptions.cpp:(.text+0x52): undefined reference to vtable for LogOptions' /usr/bin/ld: logoptions.cpp:(.text+0x64): undefined reference tovtable for LogOptions' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in function LogOptions::~LogOptions()': logoptions.cpp:(.text+0x1d5): undefined reference tovtable for LogOptions' /usr/bin/ld: logoptions.cpp:(.text+0x1e7): undefined reference to vtable for LogOptions' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::ChangeSensor(int)': logoptions.cpp:(.text+0x7fb): undefined reference to LogOptions::SyncSensorMeasurements(int)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::HideItem(int)': logoptions.cpp:(.text+0xbfd): undefined reference to LogOptions::toggle_measurement(int, int, bool)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::ShowItem(int)': logoptions.cpp:(.text+0xcef): undefined reference to LogOptions::toggle_measurement(int, int, bool)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::TogglePlot(bool)': logoptions.cpp:(.text+0xeb8): undefined reference to LogOptions::ShowSensor(int, bool)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::ToggleRender(bool)': logoptions.cpp:(.text+0xf68): undefined reference to LogOptions::RenderSensor(int, bool)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/logoptions.cpp.o: in functionLogOptions::ToggleLogging(bool)': logoptions.cpp:(.text+0xfab): undefined reference to LogOptions::toggle_logging(bool)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/controllerdialog.cpp.o: in functionControllerDialog::ControllerDialog(Klampt::Simulator, QWidget)': controllerdialog.cpp:(.text+0x54): undefined reference to vtable for ControllerDialog' /usr/bin/ld: controllerdialog.cpp:(.text+0x66): undefined reference tovtable for ControllerDialog' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/controllerdialog.cpp.o: in function ControllerDialog::~ControllerDialog()': controllerdialog.cpp:(.text+0x2b3): undefined reference tovtable for ControllerDialog' /usr/bin/ld: controllerdialog.cpp:(.text+0x2c5): undefined reference to vtable for ControllerDialog' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/controllerdialog.cpp.o: in functionControllerDialog::OnCellEdited(QTableWidgetItem)': controllerdialog.cpp:(.text+0x9ce): undefined reference to toStdString[abi:cxx11](QString const&)' /usr/bin/ld: controllerdialog.cpp:(.text+0xa0c): undefined reference totoStdString[abi:cxx11](QString const&)' /usr/bin/ld: controllerdialog.cpp:(.text+0xb1d): undefined reference to ControllerDialog::SendControllerSetting(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/controllerdialog.cpp.o: in functionControllerDialog::OnSendCommand()': controllerdialog.cpp:(.text+0xd2e): undefined reference to toStdString[abi:cxx11](QString const&)' /usr/bin/ld: controllerdialog.cpp:(.text+0xd62): undefined reference totoStdString[abi:cxx11](QString const&)' /usr/bin/ld: controllerdialog.cpp:(.text+0xd7c): undefined reference to ControllerDialog::ControllerCommand(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/controllerdialog.cpp.o: in functionControllerDialog::OnConnectSerial()': controllerdialog.cpp:(.text+0xf24): undefined reference to `ControllerDialog::MakeConnect(int, QString, int, int)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/MugatuSim.dir/build.make:219: MugatuSim] Error 1 make[1]: [CMakeFiles/Makefile2:76: CMakeFiles/MugatuSim.dir/all] Error 2 make: *** [Makefile:84: all] Error 2