Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
air_navigation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tdde05_ros2
air_navigation
Commits
c750eb2d
Commit
c750eb2d
authored
2 months ago
by
Tommy Persson
Browse files
Options
Downloads
Patches
Plain Diff
Fixe.
parent
63b6dbf6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+11
-4
11 additions, 4 deletions
CMakeLists.txt
src/python_controller.cpp
+3
-1
3 additions, 1 deletion
src/python_controller.cpp
with
14 additions
and
5 deletions
CMakeLists.txt
+
11
−
4
View file @
c750eb2d
...
@@ -18,8 +18,12 @@ find_package(nav2_common REQUIRED)
...
@@ -18,8 +18,12 @@ find_package(nav2_common REQUIRED)
find_package
(
nav2_util REQUIRED
)
find_package
(
nav2_util REQUIRED
)
# SIP/Python stuff
# SIP/Python stuff
find_package
(
PythonInterp 3.0 REQUIRED
)
#find_package(PythonInterp 3.0 REQUIRED)
find_package
(
PythonLibrary 3.0 REQUIRED
)
#find_package(PythonLibrary 3.0 REQUIRED)
#find_package(SIP 4.18.0 REQUIRED)
find_package
(
PythonInterp 3.10 REQUIRED
)
find_package
(
PythonLibrary 3.10 REQUIRED
)
find_package
(
SIP 4.18.0 REQUIRED
)
find_package
(
SIP 4.18.0 REQUIRED
)
nav2_package
()
nav2_package
()
...
@@ -36,7 +40,10 @@ set(dependencies
...
@@ -36,7 +40,10 @@ set(dependencies
pluginlib
pluginlib
nav2_util
nav2_util
nav2_costmap_2d
nav2_costmap_2d
)
)
message
(
"LIBS:
${
PYTHON_LIBRARY
}
"
)
message
(
"DEPS:
${
dependencies
}
"
)
add_library
(
air_navigation SHARED
add_library
(
air_navigation SHARED
src/python_controller.cpp
src/python_controller.cpp
...
@@ -44,7 +51,7 @@ add_library(air_navigation SHARED
...
@@ -44,7 +51,7 @@ add_library(air_navigation SHARED
src/python_trajectory_critic.cpp
src/python_trajectory_critic.cpp
src/python_trajectory_generator.cpp
)
src/python_trajectory_generator.cpp
)
target_compile_definitions
(
air_navigation PUBLIC
"PLUGINLIB__DISABLE_BOOST_FUNCTIONS"
)
target_compile_definitions
(
air_navigation PUBLIC
"PLUGINLIB__DISABLE_BOOST_FUNCTIONS"
)
target_link_libraries
(
air_navigation
${
PYTHON_LIBRARY
}
)
target_link_libraries
(
air_navigation
${
PYTHON_LIBRARY
}
)
target_include_directories
(
air_navigation
target_include_directories
(
air_navigation
PUBLIC
PUBLIC
/opt/ros/humble/include/nav_2d_msgs
/opt/ros/humble/include/nav_2d_msgs
...
...
This diff is collapsed.
Click to expand it.
src/python_controller.cpp
+
3
−
1
View file @
c750eb2d
...
@@ -19,7 +19,7 @@ void PythonController::configure(
...
@@ -19,7 +19,7 @@ void PythonController::configure(
std
::
shared_ptr
<
nav2_costmap_2d
::
Costmap2DROS
>
)
std
::
shared_ptr
<
nav2_costmap_2d
::
Costmap2DROS
>
)
{
{
auto
node
=
parent
.
lock
();
auto
node
=
parent
.
lock
();
RCLCPP_ERROR_STREAM
(
node
->
get_logger
(),
"Configuring Python controller"
);
RCLCPP_ERROR_STREAM
(
node
->
get_logger
(),
"
******************
Configuring Python controller"
);
nav2_util
::
declare_parameter_if_not_declared
(
node
,
name
+
".module"
,
rclcpp
::
ParameterValue
(
""
));
nav2_util
::
declare_parameter_if_not_declared
(
node
,
name
+
".module"
,
rclcpp
::
ParameterValue
(
""
));
nav2_util
::
declare_parameter_if_not_declared
(
node
,
name
+
".class"
,
rclcpp
::
ParameterValue
(
""
));
nav2_util
::
declare_parameter_if_not_declared
(
node
,
name
+
".class"
,
rclcpp
::
ParameterValue
(
""
));
...
@@ -65,6 +65,7 @@ geometry_msgs::msg::TwistStamped PythonController::computeVelocityCommands(
...
@@ -65,6 +65,7 @@ geometry_msgs::msg::TwistStamped PythonController::computeVelocityCommands(
nav2_core
::
GoalChecker
*
goal
)
nav2_core
::
GoalChecker
*
goal
)
{
{
python_lock
pl
;
python_lock
pl
;
if
(
m_python_controller_interface
)
if
(
m_python_controller_interface
)
{
{
py_interface
::
PoseStamped
py_pose
;
py_interface
::
PoseStamped
py_pose
;
...
@@ -86,6 +87,7 @@ geometry_msgs::msg::TwistStamped PythonController::computeVelocityCommands(
...
@@ -86,6 +87,7 @@ geometry_msgs::msg::TwistStamped PythonController::computeVelocityCommands(
void
PythonController
::
setPlan
(
const
nav_msgs
::
msg
::
Path
&
path
)
void
PythonController
::
setPlan
(
const
nav_msgs
::
msg
::
Path
&
path
)
{
{
python_lock
pl
;
python_lock
pl
;
if
(
m_python_controller_interface
)
if
(
m_python_controller_interface
)
{
{
py_interface
::
Path
py_path
;
py_interface
::
Path
py_path
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment