Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Migrate Kart Launch Architecture to Simulation Launches #11

Merged
merged 15 commits into from
Sep 25, 2021

Conversation

zghera
Copy link
Member

@zghera zghera commented Dec 30, 2020

What is a quick description of the change?

Copy the structure that was implemented in the refactoring of the kart launch files (PRs #4, #6, #7, #9) in the sim launch files to ensure our simulation testing uses the same architecture as our physical kart testing.

Is this fixing an issue?

No

Were any issues created as a result of this change?

#18, Autonomous-Motorsports-Purdue/AMP_ASSv2#25

Are there more details that are relevant?

The problems encountered and their corresponding solutions are listed below


Problem: The first hurdle to tackle when trying to migrate the kart launch file architecture was that the tfs published by the simulation node, stage_ros , differed from the tfs used in the kart launch files. This would require us to have completely different parameter files for kart and sim launch files. This would lead to a lot of duplication and thus a potentially bigger problem later down the road.
If this discrepancy was purely due to naming, we could simply switch our naming scheme to that of stage_ros'. However, there was a larger issue. In order for the simulation to use as much of the architecture used in the kart launch files, we want laserscan_matcher_node_odom to publish the odom->base_link tf. Additionally, stage_ros, has a duplicate base_link frame, base_footprint, that does not match our architecture.

Solution:

  1. The first attempted to solve the problem centered around the use of the node tf_remap. The goal was to try to selectively map the base_link->laserscan_frame to the new tf topic but this was unsuccessful.
  2. The second and successful attempt was done by customizing stage_ros to match our architecture. This was completed in Add stage_ros Package #12 and Modify stage_ros Provided Transforms #13.

Problem: After correcting the tf frame inconsistency, the main error message that occurred when launching sim_autocross_track.launch was:
[ WARN] [..., ...]: TebLocalPlannerROS: trajectory is not feasible. Resetting planner...

Solution:
One suspicion I had to the cause of this issue was the values in the parameter files. So the first rough solution to this was swapping out our move_base.launch import in sim_autocross_track.launch with teb_local_planner's move_base configuration. After some initial success (still some issues --> #18) in simulation, this was deemed to be the cause of the issue.

The param files associated with move_base.launch were modified to (mostly) match teb_local_planner_tutorials' param files as the simulated kart needed to 'fit' on the simulation track we took from teb_local_planner_tutorials. Create Issue Autonomous-Motorsports-Purdue/AMP_ASSv2#25 for determine a way to modify the params to meet our karts physical params while also maintaining our ability to test in simulation.

Check lists (check x in [ ] of list items)

  • Test written/updating
  • Tests passing
  • Coding style (indentation, etc)

No testing needed for launch file development.

Any additional comments?

Moving forward, we should ideally fix the loop closure and any other issues that come up with the simulation that uses the same configuration as our physical launch files so we can use a simulation as close to the physical world as possible. That being said, when table testing occurs, and we need to use a simulation launch file, use the previous launch file (now named sim_autocross_track_only_goal_setting.launch) to avoid issues with the new sim launch.

Resources Used to Inform these Changes:

Images to show the differences in the rqt_graph and tf view_frame outputs between the kart and the new sim launch files when trying to migrate the architecture.
OLD Sim
image
image

NEW Sim
image
image

Kart
image
image

1 Lap Run on Autocross Track
https://user-images.githubusercontent.com/39711376/103719064-36eb2180-4f96-11eb-8fd1-d35d772b19ee.mp4

@zghera zghera self-assigned this Dec 30, 2020
I tried to use tf_remap to change the names of the tf frames so that our nodes can publish the tfs we have like in the kart launch files. But this does not work because there is no good way to remove tfs from stageros. See a pretty good explination here: https://answers.ros.org/question/175013/removingdeletingignoring-odom-tf-data/. Like option 1 in that post, I am also going to try to directly modify stageros to force it to not publish the base_footprint and odom frames.
This was referenced Dec 31, 2020
@zghera zghera changed the base branch from launch_file_reorganization to modify_stage_ros January 3, 2021 00:32
@zghera
Copy link
Member Author

zghera commented Jan 6, 2021

@ihagedo thanks for the approval. Just a heads up for the future, if a PR is in draft status and you are not assigned as a reviewer, you should not give the approval just yet. Thanks!

Base automatically changed from modify_stage_ros to master January 6, 2021 17:18
The param files associated with move_base.launch were modified to (mostly) match teb_local_planner_tutorials' param files as the simulated kart needed to 'fit' on the simulation track we took from teb_local_planner_tutorials. Create Issue #19 for determine a way to modify the params to meet our karts physical params while also maintaining our ability to test in simulation.
@zghera zghera marked this pull request as ready for review April 10, 2021 21:41
@zghera zghera requested a review from gfaout as a code owner April 10, 2021 21:41
@zghera zghera requested a review from ihagedo April 10, 2021 21:41
@zghera zghera merged commit 29cbca2 into master Sep 25, 2021
@zghera zghera deleted the migrate_kart_to_sim branch September 25, 2021 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants