How to close a path msg
Hi all,
I was working in a path generation tool and I want to ask a question to see if this is possible since I did not manage to find a confident answer for my question.
The problem is the following: I have a ROS node able to extract nav_msgs/Odometry
and convert its poses into a nav_msgs/Path
. The path is working fine, and it is displayed correctly in Rviz but here is the deal; since the path have a start and end point, in Rviz it is being shown as a open loop path, while what I want is the path to be closed.
Does someone know a way to just close the path or join/merge the start/end points in order to generate a closed path, like a circle?.
Regards.
UPDATE:
In order to be more clear about how this is intended to work I will add here some important features.
- As I said previously, the path is extracted from
nav_msgs/Odometry
to generate a kind of "path mission". A low level control system of a vehicle is designed to iterate through the path points, computing the desire wheel steer to follow the path. - Since we intend to use this path in a "mission", the path itself is cyclical meaning that the vehicle is designed to continuously traverse the path in a close loop.
- As you can see, the approach regarding a change on the msg type is not feasible, since it will suppose a change in all the rest of the control nodes
- Finally, I would like to remark a naive solution that consists on not closing the path but generating an additional end point extremely close to the start point. However I would like to know if there is indeed a solution to close the path without adding additional and "artifical" points to the dataset.
Besides this, take into account that the problem is mainly a visual one, since the control node is always traking the nearest point and it does not matter if there is a tiny gap between start and end points. But, what I want is to have a good visual representation of the path.
Well, I'd say it does not make sense to do, as this is semantically something different. A path is something that has a start and an endpoint.
At least for visualization purposes, you could probably do with taking a
geometry_msgs/PolygonStamped
.If this is not what you want, you probably need to explain a bit the background of how you intend to use whatever you create later on...
Hi @mgruhler,
I updated the post to be more clear and specific. Thanks!.