magnuok / Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel

This repo contains the ros packages made for the thesis of Magnus Knaedal, spring 2020.
12 stars 4 forks source link

thesis #1

Open waynezw0618 opened 3 years ago

waynezw0618 commented 3 years ago

Hi Magnus: I found your code and it is interesting. would you please share your thesis so I can understand the code.

Your sincerely Wei

magnuok commented 3 years ago

Uploaded it to master. masteroppgave.pdf

waynezw0618 commented 3 years ago

Hi Magnus How can I run some system like guide system without ros? I have no ubuntu environment here. I see there are some communication based on ros in guideSystem. but for the test code part seem no need to run others to provide input.

Best regards Wei

magnuok commented 3 years ago

The code is built on ROS and you need it to run it out of the box. If not, you must fork and modify it based on your own needs.

waynezw0618 commented 3 years ago

Hi Magnus

Since there are three publishers & subscribers of ROS in line 45-50
https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L45-L50 I suppose those publisher are not necessary for my own usage. But I am not quite sure about the subscribers. those read Path and Twist somewhere. I can only see the Path() is used here:

https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L127

and also some listeners.

https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L860 https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L897 https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L912

but from the test https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L920-L927 seems it is no necessary to read the information outside.

would you please provide me some suggestion to replace this ros depent ? I prefer to send WPS by hand from my simulator here to generate a path and send back to my own simulator Best regards

magnuok commented 3 years ago

You can to what you describe.

rospy.Subscriber("CME/wp_pp", Path, self.wp_listener_cme) = Waypoints rospy.Subscriber("nav_syst/local_planner/path", Path, self.wp_listener) = Continous path rospy.Subscriber("/observer/eta/ned", Twist, self.eta_listener) = Position of the agent/vessel/car/whatever

If you can replace those you can use the guidance_law idenpedent of the other parts.

waynezw0618 commented 3 years ago

Hello again @magnuok I did that. but I randomly met error message when I runs into the line(since I changed to read path points by hand as we discussed, there are different in lines number, but I don't change the anything else ):

https://github.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/blob/33785eff453858fbb717d6b56ebcc6947aeaa5e0/guidance_system/src/GuidanceSystem.py#L394

here is the error message:

    self.path_generator( wp_current, psi_current, wp_next, psi_next, self.zeta, self.i)

  File "E:\DRL\boatNav2021\src\training/../boat_env\GuidanceSystem.py", line 280, in path_generator
    CP_opt = self.quadratic_programming(self.CP, zeta, psi_next)

  File "E:\DRL\boatNav2021\src\training/../boat_env\GuidanceSystem.py", line 406, in quadratic_programming
    solution = solvers.qp(self.W_456, q, self.A_opt, b)

  File "E:\anaconda3\lib\site-packages\cvxopt\coneprog.py", line 4485, in qp
    return coneqp(P, q, G, h, None, A,  b, initvals, kktsolver = kktsolver, options = options)

  File "E:\anaconda3\lib\site-packages\cvxopt\coneprog.py", line 2519, in coneqp
    misc.update_scaling(W, lmbda, ds, dz)

  File "E:\anaconda3\lib\site-packages\cvxopt\misc.py", line 450, in update_scaling
    s[:m] = base.sqrt( s[:m] )

ValueError: domain error

I found s[:m] in misc.py are NaN there. I cannot repeat the error. But It happens frequently

any suggestion

Best regards

waynezw0618 commented 3 years ago

@magnuok hello again regarding your thesis again I have a question. I donnot really understand the relation between navigation system and guidance system. since both generate path. seems navigation system gives a complex case in really world while guidance system give s something in a simple situation, is that right? or Guidance system give even fine resolution path point? Best regard

magnuok commented 3 years ago

No, look at the block diagram illustrating the different components of the system: https://raw.githubusercontent.com/magnuok/Autonomous-Path-Planning-and-Maneuvering-of-a-Surface-Vessel/master/pictures/block_diagram.png

The navigation system porduces the waypoints and the desired speed. The guidance system produces the continous desired path from the waypoints given py the navigation system, as well as the desired dynamics.

waynezw0618 commented 3 years ago

@magnuok again thanks what kind of WPs are transferred to the guidanceSystem from the navigation system? the local high resolution ones or the global low resolution ones?

magnuok commented 3 years ago

local