The purpose of this PR is to add functionality to have the global pathfinding module publish and subscribe to ROS. This PR adds a new C++ file called pathfinder_loop, which is exactly the same as pathfinder_cli, but has hardcoded command options and has a ROS publish/subscribe loop (publish path, subscribe to boat position).
Find the location that you want to create a ROS workspace (eg. cd ~)
Type the commands mkdir -p catkin_ws/srccd catkin_wscatkin_make.
Clone the local and global pathfinding repositories in the src folder: cd srcgit clone https://github.com/UBCSailbot/local-pathfinding.gitgit clone https://github.com/UBCSailbot/global-pathfinding.git
If this PR has not been merged yet, you will need to run git checkout TylerROS
Go to global pathfinding and run configure: cd src/global-pathfinding./configure
Go to workspace directory and build and source: cd ../..catkin_makesource devel/setup.bash
Run the loop roslaunch global_pathfinding pathfinding_loop.launch
You can check that it is publishing in a new terminal: cd catkin_wssource devel/setup.bashrostopic echo /globalPath
As of right now, the usual workflow should still work (eg. ./configure./build/bin/pathfinder_cli <args>.
Note: I commented out gtest because it was causing build issues. May only be my system. Need to confirm.
Note 2: I commented out catkin_package part from CMakeLists.txt and it seems to be working fine, but need to confirm. Having this uncommented makes the old workflow with configure not work, as the executables are generated in a different location.
Note 3: Currently hardcoded the start and end latlons, as well as the planet size in projects/utilities/pathfinder_loop/main.cpp. Compare projects/utilities/pathfinder_loop/main.cpp and projects/utilities/pathfinder_cli/main.cpp in a text diff to see the difference made
The purpose of this PR is to add functionality to have the global pathfinding module publish and subscribe to ROS. This PR adds a new C++ file called pathfinder_loop, which is exactly the same as pathfinder_cli, but has hardcoded command options and has a ROS publish/subscribe loop (publish path, subscribe to boat position).
How to run:
Install ROS Melodic on a Ubuntu 18.04 (or similar). http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment
Find the location that you want to create a ROS workspace (eg. cd ~)
Type the commands
mkdir -p catkin_ws/src
cd catkin_ws
catkin_make
.Clone the local and global pathfinding repositories in the src folder:
cd src
git clone https://github.com/UBCSailbot/local-pathfinding.git
git clone https://github.com/UBCSailbot/global-pathfinding.git
If this PR has not been merged yet, you will need to run
git checkout TylerROS
Go to global pathfinding and run configure:
cd src/global-pathfinding
./configure
Go to workspace directory and build and source:
cd ../..
catkin_make
source devel/setup.bash
Run the loop
roslaunch global_pathfinding pathfinding_loop.launch
You can check that it is publishing in a new terminal:
cd catkin_ws
source devel/setup.bash
rostopic echo /globalPath
As of right now, the usual workflow should still work (eg.
./configure
./build/bin/pathfinder_cli <args>
.Note: I commented out gtest because it was causing build issues. May only be my system. Need to confirm.
Note 2: I commented out catkin_package part from CMakeLists.txt and it seems to be working fine, but need to confirm. Having this uncommented makes the old workflow with configure not work, as the executables are generated in a different location.
Note 3: Currently hardcoded the start and end latlons, as well as the planet size in
projects/utilities/pathfinder_loop/main.cpp
. Compareprojects/utilities/pathfinder_loop/main.cpp
andprojects/utilities/pathfinder_cli/main.cpp
in a text diff to see the difference made