Field-Robotics-Lab / dave

Project DAVE
Apache License 2.0
224 stars 72 forks source link

Protobuf RepeatedPtrField issue with opertor[] syntax #258

Closed cs1488 closed 1 year ago

cs1488 commented 2 years ago

I am trying to install dave sim on Ubuntu 18.04 with Ros Melodic. I followed the instructions how to get the resources and got until catkin build when i faced the issue:

/uuv_ws/src/dave/gazebo/dave_gazebo_model_plugins/src/plug_and_socket_plugin.cc:479:46: error: no match for ‘**operator[]’** (operand types are ‘const google::protobuf::RepeatedPtrField<gazebo::msgs::JointWrench>’ and ‘int’)
       msgs::Vector3d f1 = contactMsg.wrench()**[j]**.body_1_wrench().force();

and:

/uuv_ws/src/dave/gazebo/dave_gazebo_model_plugins/src/plug_and_socket_plugin.cc:480:46: error: no match for ‘**operator[]**’ (operand types are ‘const google::protobuf::RepeatedPtrField<gazebo::msgs::JointWrench>’ and ‘int’)
       msgs::Vector3d f2 = contactMsg.wrench()**[j]**.body_2_wrench().force();

Here is the log file: build.make.000.log

Do i need another version of protobuf? Currently libprotoc 3.0.0 is used.

Best Regards

I could not see a direct link to #170

quarkytale commented 2 years ago

Are you using a docker image from dockwater or installing directly on your host system?

cs1488 commented 2 years ago

I am trying to install directly on host system. Should I rather use the Docker?

quarkytale commented 2 years ago

First I'll suggest to install all dependencies by:

cd ~/uuv_ws/src
git clone https://github.com/Field-Robotics-Lab/dave.git
vcs import --skip-existing --input dave/extras/repos/dave_sim.repos .
cd ~/uuv_ws
rosdep install --from-paths src --ignore-src -r -y -i
catkin build

If that still fails, can you try using the docker image? It'll be useful to reproduce the issue then.

cs1488 commented 2 years ago

So i tried:

  1. cd ~/uuv_ws/src
  2. git clone https://github.com/Field-Robotics-Lab/dave.git
  3. vcs import --skip-existing --input dave/extras/repos/dave_sim.repos .
  4. cd ~/uuv_ws
  5. rosdep install --from-paths src --ignore-src -r -y -i
  6. catkin build

Where only 5 was new. (Did the rest in my first try before) I modified the dave_sim.repos because with the git@gitlab it was lacking a permission. So i tried replacing it with the https: like suggested in the comment here: https://field-robotics-lab.github.io/dave.doc/contents/installation/Clone-Dave-Repositories/ After that i could download the repos

The error still occurs. Also it abandoned a lot of packages (52/106) I will try docker and report back after.

mabelzhang commented 2 years ago

I edited the original post to put the error messages in code blocks for easier reading. Note that we recommend using DAVE with Noetic. Melodic is community-supported. When you try Docker, try the Noetic one first. The vcs problem with dave_sim.repos has been documented in #257, so let's leave that out of this thread to keep things clean.

cs1488 commented 2 years ago

Docker image works, i can start the demo. The Docker uses noetic, while my host uses melodic (to try out uuv and uwsim and compare U.W. Simulators)

So i could not reproduce the error. Anything else i can do to resolve the issue for users that want to install on host?

For my purpose having a running version is fine. Thanks for the quick replies.

@mabelzhang thank you for adjusting my post, next time i'll pay attention to that myself.

mabelzhang commented 2 years ago

Host comparisons are hard because everyone's local setup is different, so someone else's host may have different issues from yours, and that is the exact reason we use Docker for development.

That said, your original suspicion of Protobuf version is plausible. What's your protobuf version in the working Docker image? I can't check my DAVE image at the moment but another of my Noetic images (Ubuntu 20.04) has 3.6.1.

To save you time comparing between DAVE and UUV_Simulator, I'll mention that DAVE builds on top of UUV_Simulator, so it's by definition uuv_simulator and more.

cs1488 commented 2 years ago

Hello Again, inside the Docker i got: libprotoc 3.6.1

mabelzhang commented 2 years ago

Thanks for circling back! Yeah that's what I have too. Could be a version thing.

mabelzhang commented 1 year ago

Closing old issue as problem was resolved.