leggedrobotics / ocs2

Optimal Control for Switched Systems
https://leggedrobotics.github.io/ocs2
BSD 3-Clause "New" or "Revised" License
874 stars 225 forks source link

Deploy OCS2 on the new robotic arm #93

Closed ppap36 closed 9 months ago

ppap36 commented 9 months ago

Describe the bug Hello everyone, I am a beginner in OCS2 and I would like to follow the tutorial of Manipulator to deploy MPC on my own robotic arm.

Based on my observation, I believe that deploying OCS2 on a new robotic arm mainly requires the following steps: ① creating a launch file ② creating an. info file ③ creating an. urdf file. (Directly copy the information file and launch file from the process and modify them according to their own URDF file)

I have completed the above steps, and after executing the launch file, the following error message will be generated (similar to the situation with issue60 ) 2024 1 8_ocs2_narm1报错

And the node graph is as followed arm1节点图

I tried to solve the problem, but there was only one method that had a difference, which was to change the reference of URDF to the STL file in the mesh from a relative path to an absolute path. After the modification, the result is shown in the following figure 2024 1 8_ocs2_narm2报错

And the node graph is as followed arm2节点图

(I think it is worth noticing that when I use relative path,only 1 window is opened, but when I use absolute path, 2 windows are opened) Supposed to be 2 windows. I have attached the URDF file,. INFO file, and launch file below. May I ask if anyone can provide feedback

SORRY for some reson I can only attach the urdf file but not the STL file

Thank you so much.

Desktop (please complete the following information): Ubuntu 20.04 + ros noetic

Attached files

urdf.zip

ppap36 commented 9 months ago

For further step, I deploy ocs2 on a very very simple robot arm(even without mesh). For this simple robot arm, It is quiet easy to deploy, I just copy & modify the launch file, copy & modify the .info file, copy the urdf file. After that, I run the launch file, and most of things goes well . If someone need that simple arm, I can attach them too

ppap36 commented 9 months ago

oh no! I forget to mention. For the urdf files in the zip file. image narm1 is the urdf file with the relative path narm2 is the urdf file with the absolute path

ppap36 commented 9 months ago

There is a bit process for this error. ① The absolute path and the relative path. The function RobotInterface `class MobileManipulatorInterface final : public RobotInterface { public: /**

ppap36 commented 9 months ago

Finally! The issue is settled by setting the .info file like this: set the "self collision" option from true into false