JenniferBuehler / joint-control-pkgs

Packages to control joints via JointState and JointTrajectory messages
BSD 3-Clause "New" or "Revised" License
18 stars 19 forks source link

_modelJointController not declared #2

Closed muhrix closed 7 years ago

muhrix commented 8 years ago

Hi,

I found (what I believe to be) a bug which only occurs when newer versions of Gazebo are installed (I'm using Indigo + Gazebo 5.3 at the moment).

The code within the pre-compilation directive is attempted to be compiled on my system, but _modelJointController is only declared/instantiated within an if-statement, thus going out of scope.

See: https://github.com/JenniferBuehler/joint-control-pkgs/blob/master/gazebo_joint_control/src/GazeboJointControl.cpp#L165

I can open a pull request if you'd find it useful.

JenniferBuehler commented 8 years ago

Hi, thanks for reporting this! Can you try to set GAZEBO_ADVANCED_JOINTCONTROLLER_VERSION to 5? I have only determined the current value for my system I was developing on at the time... Let me know if this works for you. I'm currently on a business trip and can only check the code later or tomorrow. Hope you found a workaround in the meantime.

Thanks! Jenny

muhrix commented 8 years ago

Hi, thanks for replying! :-)

You can check how I worked around the issue here: https://github.com/muhrix/joint-control-pkgs/commit/0dea1739fe946ff6f89cba032aa87ca8c7e9cca0

Let me know if you'd like me to open a pull request.

The code is building, though I cannot test because I'm having issues with graspit (the external lib).

JenniferBuehler commented 8 years ago

Hey,

thanks for the link, and for working on this! I will check it out as soon as I get home. Glad you have something to work with in the meantime.

May I ask which repo you are using for graspit? Are you using graspit-pkgs, and/or my graspit fork, or the original repo? Which issues are you experiencing?

By the way, you don't need GraspIt to test this repository. There is a tutorial for the Jaco arm in Gazebo which guides you through using an example setup of Jaco with Gazebo and the joint controllers here. You could use the stuff to adjust it and test with your robot... which robot are you using?

muhrix commented 8 years ago

Oh I see! I will try and test this package separately then. Thanks! :-) I'm using a Kuka LBR iiwa 14, as well as a Staubli RX160L (I haven't got a Jaco to play with).

I was using your graspit-pkgs with the master branch of the original graspit-simulator/graspit.

The problem was with graspit-ros rather than graspit-pkgs. Everything is compiling now! :-)

I'm looking forward to playing with graspit!

JenniferBuehler commented 8 years ago

Hey,

Ok, great! If you have issues with graspit-pkgs, you can post them there. By the way, using graspit-pkgs with the master branch of graspit-simulator/graspit could lead to problems, that's why I have my own graspit fork. Did you compile it separately, or did you use the default setting in graspit-pkgs which downloads and compiles graspit automatically (this would then use my fork). I think using the original graspit-simulator/graspit code should work in the meantime, as my fork has largely been synced, though I have not tested it properly yet, so this just as a warning ;) If you experience any issues, please post them.

You may also be interested in the packages in grasp-execution-pkgs for using GraspIt. It is all with the Jaco as an example, but you can probably adapt everything to your LBR iiwa/Straubli robot.

JenniferBuehler commented 7 years ago

Ultra late reply to this... sorry!

The fix you applied solved the problem, though the correct solution actually was that _modelJointController is meant to be in the narrower scope. It was only the debug printout later in line 165 which was not meant to use _modelJointController, but jointController instead.

I must have introduced this accidentally when testing on a different version so I didn't notice the new bug. Thanks for reporting.