raisimTech / raisimLib

Visit www.raisim.com
http://www.raisim.com
Other
342 stars 91 forks source link

Build Error Issue #594

Closed Kenn3o3 closed 2 months ago

Kenn3o3 commented 3 months ago

I am currently encountering several compilation errors while trying to build the RaiSim examples as documented on both your official installation guide and the YouTube tutorial series. Below are the details of the system environment and the errors encountered.

System Environment:

Error Description:

During the compilation of the RaiSim examples, specifically the synchronousServerUpdate.cpp, multiple errors are thrown indicating missing members in raisim::ArticulatedSystem. Here is the list of errors output by the compiler:

...
[ 29%] Building CXX object examples/CMakeFiles/rayDemo2.dir/src/server/rayDemo2.cpp.o
[ 30%] Linking CXX executable newtonsCradle
[ 30%] Built target newtonsCradle
[ 31%] Building CXX object examples/CMakeFiles/anymal_stress_test.dir/src/server/anymals_stress_test.cpp.o
[ 32%] Linking CXX executable visualObjects
[ 32%] Built target visualObjects
[ 34%] Building CXX object examples/CMakeFiles/compound.dir/src/server/compound.cpp.o
[ 35%] Linking CXX executable rayDemo
[ 35%] Built target rayDemo
[ 36%] Building CXX object examples/CMakeFiles/cartPole.dir/src/server/cartPole.cpp.o
[ 37%] Linking CXX executable rayDemo2
[ 37%] Built target rayDemo2
[ 38%] Building CXX object examples/CMakeFiles/springTest.dir/src/server/springTest.cpp.o
[ 39%] Linking CXX executable anymal_stress_test
[ 39%] Built target anymal_stress_test
[ 40%] Building CXX object examples/CMakeFiles/trackedRobotAndTemplatedURDF.dir/src/server/trackedRobotAndTemplatedURDF.cpp.o
[ 41%] Linking CXX executable compound
[ 41%] Built target compound
[ 42%] Building CXX object examples/CMakeFiles/kinematicObject.dir/src/server/kinematicObject.cpp.o
[ 43%] Linking CXX executable cartPole
[ 43%] Built target cartPole
[ 44%] Building CXX object examples/CMakeFiles/sensors.dir/src/server/sensors.cpp.o
[ 45%] Linking CXX executable springTest
[ 45%] Built target springTest
[ 46%] Building CXX object examples/CMakeFiles/synchronousServerUpdate.dir/src/server/synchronousServerUpdate.cpp.o
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp: In function ‘int main(int, char**)’:
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:41:36: error: ‘class raisim::ArticulatedSystem’ has no member named ‘getSensor’; did you mean ‘getSensorSet’?
   41 |   auto front_depthSensor = anymal->getSensor<raisim::DepthCamera>("depth_camera_front_camera_parent:depth");
      |                                    ^~~~~~~~~
      |                                    getSensorSet
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:41:65: error: expected primary-expression before ‘>’ token
   41 |   auto front_depthSensor = anymal->getSensor<raisim::DepthCamera>("depth_camera_front_camera_parent:depth");
      |                                                                 ^
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:44:34: error: ‘class raisim::ArticulatedSystem’ has no member named ‘getSensor’; did you mean ‘getSensorSet’?
   44 |   auto front_rgbCamera = anymal->getSensor<raisim::RGBCamera>("depth_camera_front_camera_parent:color");
      |                                  ^~~~~~~~~
      |                                  getSensorSet
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:44:61: error: expected primary-expression before ‘>’ token
   44 |   auto front_rgbCamera = anymal->getSensor<raisim::RGBCamera>("depth_camera_front_camera_parent:color");
      |                                                             ^
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:47:35: error: ‘class raisim::ArticulatedSystem’ has no member named ‘getSensor’; did you mean ‘getSensorSet’?
   47 |   auto rear_depthSensor = anymal->getSensor<raisim::DepthCamera>("depth_camera_rear_camera_parent:depth");
      |                                   ^~~~~~~~~
      |                                   getSensorSet
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:47:64: error: expected primary-expression before ‘>’ token
   47 |   auto rear_depthSensor = anymal->getSensor<raisim::DepthCamera>("depth_camera_rear_camera_parent:depth");
      |                                                                ^
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:50:33: error: ‘class raisim::ArticulatedSystem’ has no member named ‘getSensor’; did you mean ‘getSensorSet’?
   50 |   auto rear_rgbCamera = anymal->getSensor<raisim::RGBCamera>("depth_camera_rear_camera_parent:color");
      |                                 ^~~~~~~~~
      |                                 getSensorSet
/home/user3/Desktop/raisimws/raisimLib/examples/src/server/synchronousServerUpdate.cpp:50:60: error: expected primary-expression before ‘>’ token
   50 |   auto rear_rgbCamera = anymal->getSensor<raisim::RGBCamera>("depth_camera_rear_camera_parent:color");
      |                                                            ^
[ 47%] Linking CXX executable trackedRobotAndTemplatedURDF
[ 47%] Built target trackedRobotAndTemplatedURDF
[ 48%] Building CXX object examples/CMakeFiles/deletion.dir/src/server/deletion.cpp.o
make[2]: *** [examples/CMakeFiles/synchronousServerUpdate.dir/build.make:76: examples/CMakeFiles/synchronousServerUpdate.dir/src/server/synchronousServerUpdate.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:812: examples/CMakeFiles/synchronousServerUpdate.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 50%] Linking CXX executable kinematicObject
[ 50%] Built target kinematicObject
[ 51%] Linking CXX executable sensors
[ 51%] Built target sensors
[ 52%] Linking CXX executable deletion
[ 52%] Built target deletion
make: *** [Makefile:136: all] Error 2

Reproduction Steps:

  1. Followed the installation steps as outlined on RaiSim Installation Guide and the YouTube tutorial.
  2. Create the $LOCAL_INSTALL directory manually as it was not automatically created during any of the installation steps.

Additional Information: (successful runs)

It appears the $LOCAL_INSTALL folder, which is critical for the setup, remains empty after the steps:

After running cmake .. -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL -DRAISIM_EXAMPLE=ON -DRAISIM_PY=ON -DPYTHON_EXECUTABLE=$(which python):

(base) user3@REU08-HP-Z800-Workstation:~/Desktop/raisimws/raisimLib/build$ cmake .. -DCMAKE_INSTALL_PREFIX=~/Desktop/raisimws/install/ -DRAISIM_EXAMPLE=ON -DRAISIM_PY=ON -DPYTHON_EXECUTABLE=$(which python)
-- Detected OS/Architecture is linux
-- raisim:
--   Version: 1.1.8
--   Includes: /home/user3/Desktop/raisimws/raisimLib/raisim/linux/include
--   Libraries: raisim::raisimPng;raisim::raisimODE;raisim::raisimMine;raisim::raisim
CMake Deprecation Warning at thirdParty/pybind11/CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- pybind11 v2.10.4 
CMake Warning (dev) at thirdParty/pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  thirdParty/pybind11/tools/pybind11Tools.cmake:50 (find_package)
  thirdParty/pybind11/tools/pybind11Common.cmake:180 (include)
  thirdParty/pybind11/CMakeLists.txt:208 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- raisim:
--   Version: 1.1.8
--   Includes: /home/user3/Desktop/raisimws/raisimLib/raisim/linux/include
--   Libraries: raisim::raisimPng;raisim::raisimODE;raisim::raisimMine;raisim::raisim
-- python executable: /home/user3/anaconda3/bin/python
-- python site is /home/user3/anaconda3/lib/python3.10/site-packages
-- Configuring done (0.4s)
-- Generating done (0.1s)
-- Build files have been written to: /home/user3/Desktop/raisimws/raisimLib/build
eunseon02 commented 3 months ago

I solved this issue by editing the code as follows:

  auto front_depthSensor = anymal->getSensorSet("depth_camera_front_camera_parent")->getSensor<raisim::DepthCamera>("depth");
  front_depthSensor->setMeasurementSource(raisim::Sensor::MeasurementSource::VISUALIZER);

  auto front_rgbCamera = anymal->getSensorSet("depth_camera_front_camera_parent")->getSensor<raisim::RGBCamera>("color");
  front_rgbCamera->setMeasurementSource(raisim::Sensor::MeasurementSource::VISUALIZER);

  auto rear_depthSensor = anymal->getSensorSet("depth_camera_rear_camera_parent")->getSensor<raisim::DepthCamera>("depth");
  rear_depthSensor->setMeasurementSource(raisim::Sensor::MeasurementSource::VISUALIZER);

  auto rear_rgbCamera = anymal->getSensorSet("depth_camera_rear_camera_parent")->getSensor<raisim::RGBCamera>("color");
  rear_rgbCamera->setMeasurementSource(raisim::Sensor::MeasurementSource::VISUALIZER);
jhwangbo commented 3 months ago

Thx for posting. I forgot to update the example for the new sensor module. Ill do it soon

PerFrivik commented 2 months ago

Hey I see that you have the error as me, just wanted to let you know I have the same issue :+1:. Thanks for fixing!

jhwangbo commented 2 months ago

resolved in linux and windows. Mac version will follow