Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][TEST]Mppi eigen #13

Draft
wants to merge 81 commits into
base: feature/add_bt_logs
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
137f75d
Initial commit
Ayush1285 Jun 6, 2024
a2c11e6
Corrected to Eigen Array
Ayush1285 Jun 6, 2024
8df6757
updated motion model with eigen
Ayush1285 Jun 8, 2024
0f3a0f8
Replaced xtensor with eigen in Optimizer, NoiseGenerator and all Util…
Ayush1285 Jun 10, 2024
3e0bcd4
updated critics with Eigen
Ayush1285 Jun 18, 2024
f244e0a
optimized Eigen::Array implementation
Ayush1285 Aug 12, 2024
96b14d1
added comment
Ayush1285 Aug 14, 2024
62eb959
Updated path align critic and velocity deadband critic with Eigen
Ayush1285 Aug 16, 2024
3d8f987
Updated cost critic and constraint critic with eigen
Ayush1285 Aug 19, 2024
bc5b377
Updated utils test with Eigen
Ayush1285 Aug 19, 2024
5fb8006
Reverted unnecessary changes and fixed static instance in Noise gener…
Ayush1285 Aug 20, 2024
46baa06
changes std::abs to fabs, clamp to min-max
Ayush1285 Aug 23, 2024
a336814
Converted tests to Eigen
Ayush1285 Sep 2, 2024
93d017b
Complete conversion from xtensor to Eigen
Ayush1285 Sep 3, 2024
0f82afe
fixed few review comments
Ayush1285 Sep 5, 2024
b41d519
Merge branch 'main' into eigen_mppi
Ayush1285 Sep 10, 2024
ca61afc
Fixed linters and few review comments
Ayush1285 Sep 11, 2024
61a1d51
Fixed mis-merge of AckermannReversingTest
Ayush1285 Sep 11, 2024
63b1e61
fixed gtest assertion
Ayush1285 Sep 11, 2024
dfae9d5
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Sep 14, 2024
ea052a8
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Sep 16, 2024
286b3c0
Fixed optimizer_unit_tests and related issues
Ayush1285 Sep 16, 2024
d6418bd
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Oct 1, 2024
2c53db4
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Oct 2, 2024
847f837
Fixed all the unit tests and critic tests, all unit tests passing loc…
Ayush1285 Oct 2, 2024
f9ed129
fixed few review comments
Ayush1285 Oct 2, 2024
cdd489f
Merged the latest SG Filter changes
Ayush1285 Oct 5, 2024
0327754
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Oct 16, 2024
2f8bd63
Fixed CostCritic issue and added test for shiftColumn method
Ayush1285 Oct 16, 2024
55f7fae
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Oct 20, 2024
902a72d
Added test for new functions
Ayush1285 Oct 20, 2024
aa732d2
Removed compiler flags
Ayush1285 Oct 20, 2024
0d2ddf2
Try eigen branch
pepisg Nov 14, 2024
526436c
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Nov 18, 2024
1862c1c
updated test to check first and last columns
Ayush1285 Nov 20, 2024
7a398ff
Addressed few review comments
Ayush1285 Nov 20, 2024
082aab9
Merge branch 'eigen_mppi' of github.com:Ayush1285/navigation2 into ei…
Ayush1285 Nov 20, 2024
85df29c
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Nov 20, 2024
b94dad3
Merge branch 'eigen_mppi' of github.com:Ayush1285/navigation2 into ei…
Ayush1285 Nov 20, 2024
e81afc5
Changed the obstacle critic implementation to the original way. Updat…
Ayush1285 Nov 20, 2024
b78606d
Fixed bugs
Ayush1285 Nov 23, 2024
510d43c
Fixed linter
Ayush1285 Nov 23, 2024
15ee9ce
Added clamp util function
Ayush1285 Nov 23, 2024
78e6d94
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Nov 23, 2024
1e3835e
Fixed bug
Ayush1285 Nov 23, 2024
00f77e1
Fixed review comments: Added utils::clamp method
Ayush1285 Nov 27, 2024
61652cd
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Dec 5, 2024
c37d4d9
pull eigen changes
pepisg Dec 16, 2024
f1c8fd5
add bt logs
pepisg Dec 16, 2024
8e609ab
Merged main and resolved merge conflict
Ayush1285 Dec 20, 2024
6f01214
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Dec 24, 2024
78f1d61
Fixing strided trajectory columns
Ayush1285 Dec 26, 2024
aab0b55
fixed lint error
Ayush1285 Dec 26, 2024
33d3f5d
fix pathalign critic
jdgalviss Jan 6, 2025
b6036c0
Fixing strided trajectory columns
Ayush1285 Dec 26, 2024
43d7f7e
fix: Changed cloned_multi_tb3_simulation_launch.py file to conform wi…
TannerGilbert Jan 7, 2025
02336a2
Use PoseStampedArray (#4791)
tonynajjar Jan 9, 2025
051eb55
publish motion target as pose (#4839)
mikeferguson Jan 9, 2025
78f60ee
nav2_behaviors: drive_on_heading: return TIMEOUT error code when exce…
DylanDeCoeyer-Quimesis Jan 10, 2025
1684cb9
fix bug in orientation filtering (#4840)
mikeferguson Jan 10, 2025
408fbb8
Fix compilation on Windows (#4843)
traversaro Jan 10, 2025
eaa88e6
Adapt GoalUpdater to update goals as well (#4771)
tonynajjar Jan 13, 2025
7ad850a
Merge branch 'ros-navigation:main' into eigen_mppi
Ayush1285 Jan 14, 2025
f9be2df
Update ISSUE_TEMPLATE.md
SteveMacenski Jan 14, 2025
a55eb19
Update issue templates (#4850)
SteveMacenski Jan 14, 2025
30fd765
Update PULL_REQUEST_TEMPLATE.md
SteveMacenski Jan 14, 2025
c5cdde7
Update configuration-or-tuning-help.md
SteveMacenski Jan 14, 2025
bc9f2bc
Fixes smac planner non-circular footprint search issue (#4851)
SteveMacenski Jan 14, 2025
d11de56
Mppi goal to critic (#4822)
redvinaa Jan 14, 2025
694a222
Fix goal pose stamp (#4854)
redvinaa Jan 15, 2025
4dd35f1
merged into main
Ayush1285 Jan 15, 2025
cc1b48b
Fixed merge
Ayush1285 Jan 15, 2025
3be2a61
Merge branch 'eigen_mppi' of github.com:Ayush1285/navigation2 into ei…
Ayush1285 Jan 15, 2025
3460d5b
Fixed optimizer benchmark with latest api changes
Ayush1285 Jan 15, 2025
7820a41
fixed build error
Ayush1285 Jan 15, 2025
141bb6a
Fixed new util_test
Ayush1285 Jan 15, 2025
aa642bb
pull our main
pepisg Jan 15, 2025
022f003
wip: update mppi main
pepisg Jan 15, 2025
836c440
Revert "Use PoseStampedArray (#4791)"
pepisg Jan 15, 2025
26c3dd4
Revert "Adapt GoalUpdater to update goals as well (#4771)"
pepisg Jan 15, 2025
9c2740c
WIP: disable MPPI testing for now
jdgalviss Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ For Bug report or feature requests, please fill out the relevant category below

- Operating System:
- <!-- OS and version (e.g. Windows 10, Ubuntu 16.04...) -->
- Computer:
- <!-- Nvidia Jetson Orin, 13th Gen Intel NUC, Ryzen 9 7940-HS -->
- ROS2 Version:
- <!-- ROS2 distribution and install method (e.g. Foxy binaries, Dashing source...) -->
- Version or commit hash:
Expand All @@ -34,7 +36,7 @@ For Bug report or feature requests, please fill out the relevant category below
#### Additional information

<!-- If you are reporting a bug delete everything below
If you are requesting a feature deleted everything above this line -->
If you are requesting a feature deleted everything above this line & Configuration & Tuning Help -->
----
## Feature request

Expand All @@ -43,3 +45,30 @@ For Bug report or feature requests, please fill out the relevant category below

#### Implementation considerations
<!-- Relevant information on how the feature could be implemented and pros and cons of the different solutions -->

<!-- If you are reporting a bug or feature delete everything above this line -->
----
## Configuration or Tuning Help

**Required Info:**

- Operating System:
- <!-- OS and version (e.g. Windows 10, Ubuntu 16.04...) -->
- Computer:
- <!-- Nvidia Jetson Orin, 13th Gen Intel NUC, Ryzen 9 7940-HS -->
- ROS2 Version:
- <!-- ROS2 distribution and install method (e.g. Foxy binaries, Dashing source...) -->
- Version or commit hash:
- <!-- from source: output of `git -C navigation2 rev-parse HEAD
apt binaries: output of: dpkg-query --show "ros-$ROS_DISTRO-navigation2"
or: dpkg-query --show "ros-$ROS_DISTRO-nav2-*" -->
- DDS implementation:
- <!-- rmw_implementation used (e.g. Fast-RTPS, RTI Connext, etc.) -->
- Nav2 Package:
- <!-- MPPI, DWB, Smac, etc-->

#### Tuning / Configuration Goal
<!-- Description in a few sentences what the aim is that you're trying to tune / configure -->

#### What I've Tried
<!-- Description **in detail** what you've tried, methodology, graphs or figures, and progress -->
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!--
For general questions, please ask on Robotics Stack Exchange: https://robotics.stackexchange.com/, make sure to include at least the `ros2` and `nav2` tags and the rosdistro version you are running, e.g. `ardent`.
For general design discussions, please post on discourse: https://discourse.ros.org/c/ng-ros
Not sure if this is the right repository? Open an issue on https://github.com/ros-navigation/navigation2
For Bug report or feature requests, please fill out the relevant category below
-->

## Bug report

**Required Info:**

- Operating System:
- <!-- OS and version (e.g. Windows 10, Ubuntu 16.04...) -->
- Computer:
- <!-- Nvidia Jetson Orin, 13th Gen Intel NUC, Ryzen 9 7940-HS -->
- ROS2 Version:
- <!-- ROS2 distribution and install method (e.g. Foxy binaries, Dashing source...) -->
- Version or commit hash:
- <!-- from source: output of `git -C navigation2 rev-parse HEAD
apt binaries: output of: dpkg-query --show "ros-$ROS_DISTRO-navigation2"
or: dpkg-query --show "ros-$ROS_DISTRO-nav2-*" -->
- DDS implementation:
- <!-- rmw_implementation used (e.g. Fast-RTPS, RTI Connext, etc.) -->

#### Steps to reproduce issue
<!-- Detailed instructions on how to reliably reproduce this issue http://sscce.org/
``` code that can be copy-pasted is preferred ``` -->
```

```

#### Expected behavior

#### Actual behavior

#### Reproduction instructions

#### Additional information
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/configuration-or-tuning-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Configuration or Tuning Help
about: Help in Setting Up Nav2 for your Robot (non-bug, non-feature)
title: ''
labels: question
assignees: ''

---

<!--
For general questions, please ask on Robotics Stack Exchange: https://robotics.stackexchange.com/, make sure to include at least the `ros2` and `nav2` tags and the rosdistro version you are running, e.g. `ardent`.
For general design discussions, please post on discourse: https://discourse.ros.org/c/ng-ros
Not sure if this is the right repository? Open an issue on https://github.com/ros-navigation/navigation2
For Bug report or feature requests, please fill out the relevant category below
-->

**Required Info:**

- Operating System:
- <!-- OS and version (e.g. Windows 10, Ubuntu 16.04...) -->
- Computer:
- <!-- Nvidia Jetson Orin, 13th Gen Intel NUC, Ryzen 9 7940-HS -->
- ROS2 Version:
- <!-- ROS2 distribution and install method (e.g. Foxy binaries, Dashing source...) -->
- Version or commit hash:
- <!-- from source: output of `git -C navigation2 rev-parse HEAD
apt binaries: output of: dpkg-query --show "ros-$ROS_DISTRO-navigation2"
or: dpkg-query --show "ros-$ROS_DISTRO-nav2-*" -->
- DDS implementation:
- <!-- rmw_implementation used (e.g. Fast-RTPS, RTI Connext, etc.) -->
- Nav2 Package:
- <!-- MPPI, DWB, Smac, etc-->
- Have you asked this on Robotics Stack Exchange?
- <!-- If yes, provide a link -->

#### Tuning / Configuration Goal
<!-- Description in a few sentences what the aim is that you're trying to tune / configure -->

#### What I've Tried
<!-- Description **in detail** what you've tried, methodology, graphs or figures, and progress -->
<!-- Note: Maintainer time is limited, understand that you may be directed to community resources like docs.nav2.org, Robotics Stack Exchange, or other help resources. -->
<!-- Note: If this is a commercial application and you would like professional hands-on support, please contact [email protected] instead. -->
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

## Feature request

#### Feature description
<!-- Description in a few sentences what the feature consists of and what problem it will solve -->

#### Implementation considerations
<!-- Relevant information on how the feature could be implemented and pros and cons of the different solutions -->
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
* I added some capabilities, need to document them
-->

## Description of how this change was tested

<!--
* I wrote unit tests that cover 90%+ of changes and extensively tested on my physical robot platform in production for 1 week
* I wrote unit tests and tested in simulation for 10 minutes
-->

---

## Future work that may be required in bullet points
Expand Down
13 changes: 11 additions & 2 deletions nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,17 @@ inline BT::NodeStatus GoalUpdater::tick()

callback_group_executor_.spin_some();

if (rclcpp::Time(last_goal_received_.header.stamp) > rclcpp::Time(goal.header.stamp)) {
goal = last_goal_received_;
if (last_goal_received_.header.stamp != rclcpp::Time(0)) {
auto last_goal_received_time = rclcpp::Time(last_goal_received_.header.stamp);
auto goal_time = rclcpp::Time(goal.header.stamp);
if (last_goal_received_time > goal_time) {
goal = last_goal_received_;
} else {
RCLCPP_WARN(
node_->get_logger(), "The timestamp of the received goal (%f) is older than the "
"current goal (%f). Ignoring the received goal.",
last_goal_received_time.seconds(), goal_time.seconds());
}
}

setOutput("output_goal", goal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class DriveOnHeading : public TimedBehavior<ActionT>
RCLCPP_WARN(
this->logger_,
"Exceeded time allowance before reaching the DriveOnHeading goal - Exiting DriveOnHeading");
return ResultStatus{Status::FAILED, ActionT::Result::NONE};
return ResultStatus{Status::FAILED, ActionT::Result::TIMEOUT};
}

geometry_msgs::msg::PoseStamped current_pose;
Expand Down
136 changes: 74 additions & 62 deletions nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,69 @@
from nav2_common.launch import ParseMultiRobotPose


def generate_robot_actions(context, *args, **kwargs):
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')
use_rviz = LaunchConfiguration('use_rviz')
params_file = LaunchConfiguration('params_file')
autostart = LaunchConfiguration('autostart')
rviz_config_file = LaunchConfiguration('rviz_config')
map_yaml_file = LaunchConfiguration('map')
use_robot_state_pub = LaunchConfiguration('use_robot_state_pub')

robots_substitution = ParseMultiRobotPose(LaunchConfiguration('robots'))
robots_list = robots_substitution.perform(context)

# Define commands for launching the navigation instances
bringup_cmd_group = []
for robot_name in robots_list:
init_pose = robots_list[robot_name]
group = GroupAction(
[
LogInfo(
msg=['Launching namespace=', robot_name, ' init_pose=', str(init_pose),]
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': TextSubstitution(text=robot_name),
'rviz_config': rviz_config_file,
}.items(),
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(bringup_dir, 'launch', 'tb3_simulation_launch.py')
),
launch_arguments={
'namespace': robot_name,
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': params_file,
'autostart': autostart,
'use_rviz': 'False',
'use_simulator': 'False',
'headless': 'False',
'use_robot_state_pub': use_robot_state_pub,
'x_pose': TextSubstitution(text=str(init_pose['x'])),
'y_pose': TextSubstitution(text=str(init_pose['y'])),
'z_pose': TextSubstitution(text=str(init_pose['z'])),
'roll': TextSubstitution(text=str(init_pose['roll'])),
'pitch': TextSubstitution(text=str(init_pose['pitch'])),
'yaw': TextSubstitution(text=str(init_pose['yaw'])),
'robot_name': TextSubstitution(text=robot_name),
}.items(),
),
]
)

bringup_cmd_group.append(group)
bringup_cmd_group.append(LogInfo(msg=['number_of_robots=', str(len(robots_list))]))
return bringup_cmd_group


def generate_launch_description():
"""
Bring up the multi-robots with given launch arguments.
Expand All @@ -49,7 +112,6 @@ def generate_launch_description():
"""
# Get the launch directory
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')
sim_dir = get_package_share_directory('nav2_minimal_tb3_sim')

# Simulation settings
Expand All @@ -61,7 +123,6 @@ def generate_launch_description():
autostart = LaunchConfiguration('autostart')
rviz_config_file = LaunchConfiguration('rviz_config')
use_robot_state_pub = LaunchConfiguration('use_robot_state_pub')
use_rviz = LaunchConfiguration('use_rviz')
log_settings = LaunchConfiguration('log_settings', default='true')

# Declare the launch arguments
Expand All @@ -71,6 +132,13 @@ def generate_launch_description():
description='Full path to world file to load',
)

declare_robots_cmd = DeclareLaunchArgument(
'robots',
default_value="""robot1={x: 0.5, y: 0.5, yaw: 0};
robot2={x: -0.5, y: -0.5, z: 0, roll: 0, pitch: 0, yaw: 1.5707}""",
description='Robots and their initialization poses in YAML format',
)

declare_map_yaml_cmd = DeclareLaunchArgument(
'map',
default_value=os.path.join(bringup_dir, 'maps', 'tb3_sandbox.yaml'),
Expand All @@ -93,7 +161,8 @@ def generate_launch_description():

declare_rviz_config_file_cmd = DeclareLaunchArgument(
'rviz_config',
default_value=os.path.join(bringup_dir, 'rviz', 'nav2_default_view.rviz'),
default_value=os.path.join(
bringup_dir, 'rviz', 'nav2_default_view.rviz'),
description='Full path to the RVIZ config file to use.',
)

Expand Down Expand Up @@ -121,60 +190,6 @@ def generate_launch_description():
OpaqueFunction(function=lambda _: os.remove(world_sdf))
]))

robots_list = ParseMultiRobotPose('robots').value()

# Define commands for launching the navigation instances
bringup_cmd_group = []
for robot_name in robots_list:
init_pose = robots_list[robot_name]
group = GroupAction(
[
LogInfo(
msg=[
'Launching namespace=',
robot_name,
' init_pose=',
str(init_pose),
]
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': TextSubstitution(text=robot_name),
'rviz_config': rviz_config_file,
}.items(),
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(bringup_dir, 'launch', 'tb3_simulation_launch.py')
),
launch_arguments={
'namespace': robot_name,
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': params_file,
'autostart': autostart,
'use_rviz': 'False',
'use_simulator': 'False',
'headless': 'False',
'use_robot_state_pub': use_robot_state_pub,
'x_pose': TextSubstitution(text=str(init_pose['x'])),
'y_pose': TextSubstitution(text=str(init_pose['y'])),
'z_pose': TextSubstitution(text=str(init_pose['z'])),
'roll': TextSubstitution(text=str(init_pose['roll'])),
'pitch': TextSubstitution(text=str(init_pose['pitch'])),
'yaw': TextSubstitution(text=str(init_pose['yaw'])),
'robot_name': TextSubstitution(text=robot_name),
}.items(),
),
]
)

bringup_cmd_group.append(group)

set_env_vars_resources = AppendEnvironmentVariable(
'GZ_SIM_RESOURCE_PATH', os.path.join(sim_dir, 'models'))
set_env_vars_resources2 = AppendEnvironmentVariable(
Expand All @@ -188,6 +203,7 @@ def generate_launch_description():

# Declare the launch options
ld.add_action(declare_world_cmd)
ld.add_action(declare_robots_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_params_file_cmd)
ld.add_action(declare_use_rviz_cmd)
Expand All @@ -200,8 +216,6 @@ def generate_launch_description():
ld.add_action(start_gazebo_cmd)
ld.add_action(remove_temp_sdf_file)

ld.add_action(LogInfo(msg=['number_of_robots=', str(len(robots_list))]))

ld.add_action(
LogInfo(condition=IfCondition(log_settings), msg=['map yaml: ', map_yaml_file])
)
Expand All @@ -223,8 +237,6 @@ def generate_launch_description():
ld.add_action(
LogInfo(condition=IfCondition(log_settings), msg=['autostart: ', autostart])
)

for cmd in bringup_cmd_group:
ld.add_action(cmd)
ld.add_action(OpaqueFunction(function=generate_robot_actions))

return ld
Loading
Loading