Place the contents of this repo inside $MR_DIR/ws02/src/mr_goto
git clone git@github.com:VincentKen/MR-GoTo.git $MR_DIR/ws02/src/mr_goto
replace ekf_node.cpp and ekf_node.hpp with the ones in MR_EKF
also in your ekf.cpp add reset_ = Reset::INTI_POSE;
to set_init_pose
void EKF::set_init_pose(const Pose2D &p) { if (!init_pose_) init_pose_ = make_shared<Pose2D>(p); else *init_pose_ = p; reset_ = Reset::INTI_POSE; }
same for pf
replace particle_filter_node.cpp and particle_filter_node.hpp with the ones in MR_PF
also in your particle.cpp add reset_ = Reset::INTI_POSE;
to set_init_pose
void ParticleFilter::set_init_pose(const Pose2D &p) { if (!init_pose_) init_pose_ = make_shared<Pose2D>(p); else *init_pose_ = p; reset_ = Reset::INTI_POSE; }
tuw::Pose2DPtr ParticleFilter::compute_estimated_pose() { if (!samples_.empty()){ std::sort(samples_.begin(), samples_.end(), Sample::greater); estimated_pose_ = samples_.at(0); } return estimated_pose_; }
Build using colcon build
Run using ros2 run mr_goto mr_goto
We can also choose the map file we want mr_goto
to run with.
ros2 run mr_goto mr_goto --ros-args -p map_file:=<path_to_map>
or with the launch file:
ros2 launch mr_goto launch.py map:=<name_of_map>
For example:
ros2 launch mr_goto launch.py map:=cave
Note: Per default, we are using the line
map.
You first need to execute
make build-ws02
in the project's root directory.
Launch using
ros2 launch mr_goto launch.py
You can also specify the map you want to use by using an additional map
argument.
ros2 launch mr_goto launch.py map:=<map_name>
For example:
ros2 launch mr_goto launch.py map:=cave
Note: Per default, we are using the line
map.
For launching the ekf
or pf
node, execute
ros2 launch mr_goto launch.py localization:=<node>
For example:
ros2 launch mr_goto launch.py localization:=ekf
Optionally, you can start the launch file with a parameter file by executing:
ros2 launch mr_goto launch.py params_file:=ws02/src/mr_goto/config/params.yaml
The params.yml
file is a relative path to your YAML configuration file.
A sample params file would look like this:
goto:
ros__parameters:
map: cave
localization: pf
Note: As described in the previous sections, the parameters have their default values set to map:=line
and localization:=ekf
.
- Thomas Khlebovitch (01427030)
- Benjamin Gallauner
- Julius Salamon (51824212)
- Vincent Kenbeek (12229949)
-
Thomas Khlebovitch
- Create launch files (80 points)
-
Benjamin Gallauner
- Set target pose (20 points)
- Drive to target without obstacles (25 points)
- Drive to target without obstacles and correct the pose at finish (25 points)
- Make robot avoid small movable obstacle (25 points)
- Navigate cave obstacle (25 points)
-
Julius Salamon
- published Map(45points)
- Initialize self-localization and trigger driving using RViz (50 Points)
- Added parameters to node
- Adjusted EKF and PF to publish the pose and get the init pose
-
Vincent Kenbeek
- Create a new node (50 points)
- Plan waypoints to target pose and publish them (50 points)
As can be seen from the image below. We created a new node in ROS. In the beginning this node only had a simple timer callback but was later extended to incorporate the other completed tasks as well.
We implemented our self localization using our own method. The screenshot below shows our node printing the x coordinate of the robot.
The target pose for our robot is set in Rviz as can be seen from the following screenshot.
After setting the target pose, the robot drives towards the target and stops there as can bee seen from the following sequence of screenshots.
Once the robot has reached the target location it will turn into the right pose as can be seen from the following screenshot.
On the way to the target the robot will avoid small obstacles.
The following screenshots show that the robot is also capable of navigating cave obstacles.
The node will once a target pose has been set calculate a path to the target goal through breadth-first search. Once the path has been calculated it will publish the waypoints to ROS nav_msgs/Path. The screenshot below shows the waypoints being published and it also gives a visualization of the proposed path.
Documented in section Launch.
As shown in the screenshot below, the node listens to /initialpose and /goal so it can be initialized and the driving can be triggered through RViz.
We believe that with the completed tasks we have managed to get 415 points, in addition, we have also used a branching strategy where completed tasks were first push to devel to be tested, this gives us an additional 20 points for a total of 435 points. We believe that the work balance was ditributed equally and so we want these points to be divided between us evenly.
The image below shows that we used a branching strategy for our git