Open noke-cmu opened 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
<klampt package_root="../.." flip_yz="1" use_vis_geom="1" />
yes, I'm currently using it like this:
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: @.***>
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
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?
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~~~~^~
/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
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 of
tempnam' is dangerous, better use mkstemp' /usr/bin/ld: CMakeFiles/MugatuSim.dir/home/naomio/Klampt/Cpp/Main/SimTestQt/qsimtestgui.cpp.o: in function
QSimTestGUI::QSimTestGUI(QKlamptDisplay, Klampt::SimTestBackend)':
qsimtestgui.cpp:(.text+0x79): undefined reference to vtable for QSimTestGUI' /usr/bin/ld: qsimtestgui.cpp:(.text+0x8e): undefined reference to
vtable 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 to
vtable 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 function
QKlamptGUIBase::QKlamptGUIBase(QKlamptDisplay, Klampt::GenericBackendBase)':
qklamptguibase.cpp:(.text+0x3e): undefined reference to vtable for QKlamptGUIBase' /usr/bin/ld: qklamptguibase.cpp:(.text+0x50): undefined reference to
vtable 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 to
vtable 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 function
QtGUIBase::QtGUIBase(Klampt::GenericBackendBase)':
qtguibase.cpp:(.text+0x40): undefined reference to vtable for QtGUIBase' /usr/bin/ld: qtguibase.cpp:(.text+0x52): undefined reference to
vtable 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 to
vtable 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 function
DriverEdit::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 to
vtable 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 to
vtable 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 function
DriverEdit::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 function
DriverEdit::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 function
LogOptions::LogOptions(QWidget)':
logoptions.cpp:(.text+0x52): undefined reference to vtable for LogOptions' /usr/bin/ld: logoptions.cpp:(.text+0x64): undefined reference to
vtable 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 to
vtable 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 function
LogOptions::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 function
LogOptions::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 function
LogOptions::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 function
LogOptions::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 function
LogOptions::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 function
LogOptions::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 function
ControllerDialog::ControllerDialog(Klampt::Simulator, QWidget)':
controllerdialog.cpp:(.text+0x54): undefined reference to vtable for ControllerDialog' /usr/bin/ld: controllerdialog.cpp:(.text+0x66): undefined reference to
vtable 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 to
vtable 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 function
ControllerDialog::OnCellEdited(QTableWidgetItem)':
controllerdialog.cpp:(.text+0x9ce): undefined reference to toStdString[abi:cxx11](QString const&)' /usr/bin/ld: controllerdialog.cpp:(.text+0xa0c): undefined reference to
toStdString[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 function
ControllerDialog::OnSendCommand()':
controllerdialog.cpp:(.text+0xd2e): undefined reference to toStdString[abi:cxx11](QString const&)' /usr/bin/ld: controllerdialog.cpp:(.text+0xd62): undefined reference to
toStdString[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 function
ControllerDialog::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
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" ?>