tesseract-robotics / trajopt

Trajectory Optimization Motion Planner for ROS
379 stars 102 forks source link

trajopt_ros-2/trajopt_sco/src/osqp_interface.cpp:175:32: error: cannot convert ‘OSQPData*’ to ‘OSQPWorkspace**’ 175 | osqp_workspace_ = osqp_setup(&osqp_data_, &osqp_settings_); #346

Closed LYCICI1990 closed 9 months ago

LYCICI1990 commented 1 year ago
I'm trying to install TrajOpt to intergrate with the ROS2. I have download the tesseract_ros2 and all its dependencies from https://github.com/tesseract-robotics/tesseract_ros2 ,also the trajOpt_ros2 from https://github.com/Levi-Armstrong/trajopt_ros-2. But during building ,some error ocurr. See my terminal output below: `/home/xxx/ws_moveit2/src/trajopt_ros-2/trajopt_sco/src/osqp_interface.cpp: In member function ‘void sco::OSQPModel::createOrUpdateSolver()’: /home/lyc/ws_moveit2/src/trajopt_ros-2/trajopt_sco/src/osqp_interface.cpp:175:32: error: cannot convert ‘OSQPData*’ to ‘OSQPWorkspace**’ 175 osqpworkspace = osqp_setup(&osqpdata, &osqpsettings); ^~~
OSQPData*

` How can i fix it and proceed? Thank you in advance!

Levi-Armstrong commented 1 year ago

Please use the dependencies rosinstall found in the tesseract_ros2 repository here to acquire the correct repositories as you are pull the wrong one for trajopt.

LYCICI1990 commented 1 year ago

Thank you very much for your answer and instrution. I have repeatedly checked the dependencies rosinstall found in the tesseract_ros2 repository which you showed to me , it seems the same with the ones I have pulled and no missing(include the trajopt). But maybe because I have also pull the trajopt_ros-2 , when compiling, the system prompts that there are a few duplicate files in trajopt and trajopt_ros-2, so I delete one of them ,is it because this reason? So what should i do to deal with these duplicate files? Maybe just leave them alone? By the way, I also want to ask which branch of the trajopt_ros-2 should I pull for my ROS2-humble version, the default kinetic-devel or the master? Does that make some difference? I am new to the ROS2 , tesseract_ros2 and the trajopt_ros-2,so I am very sorry if I asked some stupid or weird question though I have serched for a long time but not found the proper solve method . Thank you very much for your patience and answer

LYCICI1990 commented 1 year ago

The error for the duplicate package/files is as follow: [[0.686s] ERROR:colcon:colcon build: Duplicate package names not supported:

Levi-Armstrong commented 1 year ago

In your original post you were pulled trajopt from my personal fork which is out dated. I would remove this repository completely and install the under the tesseract-robotics organization.

LYCICI1990 commented 1 year ago

So, what should i do to proceed? Is there some instruction can be shown to me. Thank you very much.

Levi-Armstrong commented 1 year ago
LYCICI1990 commented 1 year ago

Thank you so much for your instruction step by step. I am so grateful. I try it but meet some new question when run into the seven step. See my terminal output below:

xxx@xxx-vm:~/tesseract_ws/src$ rosdep install -y --from-paths ~/tesseract_ws/src --ignore-src --rosdistro '<update ros2 distro>'
WARNING: given --rosdistro <update ros2 distro> but ROS_DISTRO is "humble". Ignoring environment.
WARNING: ROS_PYTHON_VERSION is unset. Defaulting to 3
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
tesseract_time_parameterization: Cannot locate rosdep definition for [ruckig]
tesseract_task_composer: Cannot locate rosdep definition for [taskflow]
tesseract_qt: Cannot locate rosdep definition for [gz-math7]
trajopt: Cannot locate rosdep definition for [trajopt_sco]
tesseract_motion_planners: Cannot locate rosdep definition for [trajopt_sco]

Then I look up the "ROS answer" and find a similar question here (https://answers.ros.org/question/400079/error-the-following-packagesstacks-could-not-have-their-rosdep-keys-resolved-to-system-dependencies/), I tryed with rosdep update --include-eol-distros and later again with my rosdep install -y --from-paths ~/tesseract_ws/src --ignore-src --rosdistro '<update ros2 distro>'again but it was still not fixed,the same error is shown again. Do you know what's wrong with it?

LYCICI1990 commented 1 year ago

I have fix some of the "Cannot locate rosdep definition [some package name]", but there still left two:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
tesseract_task_composer: Cannot locate rosdep definition for [taskflow]
tesseract_qt: Cannot locate rosdep definition for [gz-math7]

I found the [taskflow] in the tesseract_task_composer package but why it cannot locate? Then the [gz-math7] seem to be installed manully?

Levi-Armstrong commented 12 months ago

These two keys are not in rosdistro yet so you can ignore them and install manually. You can install gazebo depends using sudo apt install libgz-math and for taskflow you can install from this ppa

Levi-Armstrong commented 9 months ago

Please reopen if still having issues.