skumra / baxter-pnp

Baxter Pick and Place using GR-ConvNet. IROS 2020.
GNU General Public License v3.0
62 stars 14 forks source link

Could this be applied on ROS Melodic? #4

Closed YourSonnet18 closed 3 years ago

YourSonnet18 commented 3 years ago

Can this be applied on ROS Melodic, which can be installed on Ubuntu18.04? The ROS Kinetic will no longer be supported soon according to http://wiki.ros.org. When I ran the code catkin_make, with Ubuntu18.04 and ROS Melodic, I got this:

Base path: /media/ghost/start/zyc/GR-ConvNet/ros_ws
Source space: /media/ghost/start/zyc/GR-ConvNet/ros_ws/src
Build space: /media/ghost/start/zyc/GR-ConvNet/ros_ws/build
Devel space: /media/ghost/start/zyc/GR-ConvNet/ros_ws/devel
Install space: /media/ghost/start/zyc/GR-ConvNet/ros_ws/install
####
#### Running command: "cmake /media/ghost/start/zyc/GR-ConvNet/ros_ws/src -DCATKIN_DEVEL_PREFIX=/media/ghost/start/zyc/GR-ConvNet/ros_ws/devel -DCMAKE_INSTALL_PREFIX=/media/ghost/start/zyc/GR-ConvNet/ros_ws/install -G Unix Makefiles" in "/media/ghost/start/zyc/GR-ConvNet/ros_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /media/ghost/start/zyc/GR-ConvNet/ros_ws/devel
-- Using CMAKE_PREFIX_PATH: /media/ghost/start/zyc/GR-ConvNet/catkin_ws/devel;/opt/ros/melodic
-- This workspace overlays: /media/ghost/start/zyc/GR-ConvNet/catkin_ws/devel;/opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /media/ghost/start/zyc/GR-ConvNet/ros_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 16 packages in topological order:
-- ~~  - baxter_common (metapackage)
-- ~~  - baxter_description
-- ~~  - baxter_sdk (metapackage)
-- ~~  - baxter_simulator (metapackage)
-- ~~  - rethink_ee_description
-- ~~  - baxter_maintenance_msgs
-- ~~  - baxter_core_msgs
-- ~~  - baxter_interface
-- ~~  - baxter_sim_controllers
-- ~~  - baxter_sim_io
-- ~~  - baxter_tools
-- ~~  - baxter_gazebo
-- ~~  - baxter_sim_kinematics
-- ~~  - baxter_sim_hardware
-- ~~  - baxter_sim_examples
-- ~~  - baxter_examples
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'baxter_common'
-- ==> add_subdirectory(baxter_common/baxter_common)
-- +++ processing catkin package: 'baxter_description'
-- ==> add_subdirectory(baxter_common/baxter_description)
-- +++ processing catkin metapackage: 'baxter_sdk'
-- ==> add_subdirectory(baxter/baxter_sdk)
-- +++ processing catkin metapackage: 'baxter_simulator'
-- ==> add_subdirectory(baxter_simulator/baxter_simulator)
-- +++ processing catkin package: 'rethink_ee_description'
-- ==> add_subdirectory(baxter_common/rethink_ee_description)
-- +++ processing catkin package: 'baxter_maintenance_msgs'
-- ==> add_subdirectory(baxter_common/baxter_maintenance_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- baxter_maintenance_msgs: 7 messages, 0 services
-- +++ processing catkin package: 'baxter_core_msgs'
-- ==> add_subdirectory(baxter_common/baxter_core_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- baxter_core_msgs: 25 messages, 4 services
-- +++ processing catkin package: 'baxter_interface'
-- ==> add_subdirectory(baxter_interface)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'baxter_sim_controllers'
-- ==> add_subdirectory(baxter_simulator/baxter_sim_controllers)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Could NOT find effort_controllers (missing: effort_controllers_DIR)
-- Could not find the required component 'effort_controllers'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "effort_controllers" with any of the following names:

    effort_controllersConfig.cmake
    effort_controllers-config.cmake

  Add the installation prefix of "effort_controllers" to CMAKE_PREFIX_PATH or
  set "effort_controllers_DIR" to a directory containing one of the above
  files.  If "effort_controllers" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  baxter_simulator/baxter_sim_controllers/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/media/ghost/start/zyc/GR-ConvNet/ros_ws/build/CMakeFiles/CMakeOutput.log".
See also "/media/ghost/start/zyc/GR-ConvNet/ros_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

I'm not sure if it arose out of the wrong distribution of ROS or not. But there had been no errors when I ran catkin_make in a project which was initialized using catkin_init_workspace. Thanks for your work!

YourSonnet18 commented 3 years ago

Well, it was easily solved by sudo apt-get install ros-melodic-effort-controllers, according to https://github.com/tu-darmstadt-ros-pkg/hector_quadrotor/issues/73#issuecomment-539649217, but with more errors arising...

...

/media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:272:38: error: no matching function for call to ‘urdf::Model::getLink(std::__cxx11::string&)’
   link = robot_model.getLink(tip_name);
                                      ^
In file included from /opt/ros/melodic/include/kdl_parser/kdl_parser.hpp:42:0,
                 from /media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/include/baxter_sim_kinematics/arm_kinematics.h:42,
                 from /media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:36:
/usr/include/urdf_model/model.h:92:8: note: candidate: void urdf::ModelInterface::getLink(const string&, int&) const
   void getLink(const std::string& name, LinkSharedPtr &link) const
        ^
/usr/include/urdf_model/model.h:92:8: note:   candidate expects 2 arguments, 1 provided
/media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:275:25: error: ‘class urdf::Model’ has no member named ‘getJoint’
     joint = robot_model.getJoint(link->parent_joint->name);
                         ^
/media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:275:40: error: ‘const class urdf::Link’ has no member named ‘parent_joint’
     joint = robot_model.getJoint(link->parent_joint->name);
                                        ^
/media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:283:24: error: ‘const class urdf::Joint’ has no member named ‘limits’
         lower = joint->limits->lower;
                        ^
/media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:284:24: error: ‘const class urdf::Joint’ has no member named ‘limits’
         upper = joint->limits->upper;
                        ^
/media/ghost/start/zyc/GR-ConvNet/ros_ws/src/baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp:299:38: error: ‘const class urdf::Link’ has no member named ‘getParent’
     link = robot_model.getLink(link->getParent()->name);
                                      ^
baxter_simulator/baxter_sim_kinematics/CMakeFiles/baxter_sim_kinematics.dir/build.make:62: recipe for target 'baxter_simulator/baxter_sim_kinematics/CMakeFiles/baxter_sim_kinematics.dir/src/arm_kinematics.cpp.o' failed
make[2]: *** [baxter_simulator/baxter_sim_kinematics/CMakeFiles/baxter_sim_kinematics.dir/src/arm_kinematics.cpp.o] Error 1
CMakeFiles/Makefile2:5886: recipe for target 'baxter_simulator/baxter_sim_kinematics/CMakeFiles/baxter_sim_kinematics.dir/all' failed
make[1]: *** [baxter_simulator/baxter_sim_kinematics/CMakeFiles/baxter_sim_kinematics.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
YourSonnet18 commented 3 years ago

Well, I solved my compilation problems of baxter_simulator according to the original repository: https://github.com/RethinkRobotics/baxter_simulator First, I followed the pull request: https://github.com/RethinkRobotics/baxter_simulator/pull/130 to modify some files. Then, as for the error:

#error This file requires compiler and library support for the ISO C++ 2011

I added SET(CMAKE_CXX_FLAGS "-std=c++0x") in ros_ws/src/baxter_simulator/baxter_sim_controllers/CMakeLists.txt. And for the error:

/opt/ros/melodic/include/tf/tf.h:354:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type

I added add_compile_options(-std=c++11) in ros_ws/src/baxter_simulator/baxter_sim_kinematics/CMakeLists.txt and ros_ws/src/baxter_simulator/baxter_sim_hardware/CMakeLists.txt.

No more errors then.

plinioMoreno commented 3 years ago

@YourSonnet18, that sounds good. I want to know you were able to test this on the real robot?

YourSonnet18 commented 3 years ago

@YourSonnet18, that sounds good. I want to know you were able to test this on the real robot?

I'm sorry that I don't have a real robot... So I have the same trouble as #2

Hsuweehou commented 2 years ago

have you solved https://github.com/skumra/baxter-pnp/issues/2