Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Robobin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plw1g21
Robobin
Commits
ba8ead16
Commit
ba8ead16
authored
6 months ago
by
Paul-Winpenny
Browse files
Options
Downloads
Patches
Plain Diff
Bunch of logging statements, issue with converting to a Point message
parent
6741b49f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ros2/src/robobin/robobin/control_feedback.py
+1
-1
1 addition, 1 deletion
ros2/src/robobin/robobin/control_feedback.py
ros2/src/robobin/robobin/uwb_navigation_node.py
+6
-2
6 additions, 2 deletions
ros2/src/robobin/robobin/uwb_navigation_node.py
with
7 additions
and
3 deletions
ros2/src/robobin/robobin/control_feedback.py
+
1
−
1
View file @
ba8ead16
...
@@ -252,7 +252,7 @@ class MotorControlNode(Node):
...
@@ -252,7 +252,7 @@ class MotorControlNode(Node):
def
stop_motors
(
self
):
def
stop_motors
(
self
):
self
.
motor
.
stop
()
self
.
motor
.
stop
()
self
.
get_logger
().
info
(
'
Motors have been stopped.
'
)
#
self.get_logger().info('Motors have been stopped.')
class
Motor
:
class
Motor
:
def
__init__
(
self
,
node
,
EnaA
,
In1A
,
In2A
,
EnaB
,
In1B
,
In2B
):
def
__init__
(
self
,
node
,
EnaA
,
In1A
,
In2A
,
EnaB
,
In1B
,
In2B
):
...
...
This diff is collapsed.
Click to expand it.
ros2/src/robobin/robobin/uwb_navigation_node.py
+
6
−
2
View file @
ba8ead16
...
@@ -299,18 +299,22 @@ class UWBNode(Node):
...
@@ -299,18 +299,22 @@ class UWBNode(Node):
if
self
.
mode
==
"
Call
"
and
self
.
call_mode_active
:
if
self
.
mode
==
"
Call
"
and
self
.
call_mode_active
:
self
.
get_logger
().
info
(
"
Call mode active.
"
)
if
self
.
current_tag1_position
is
not
None
and
self
.
current_target_index
<
len
(
self
.
path
):
if
self
.
current_tag1_position
is
not
None
and
self
.
current_target_index
<
len
(
self
.
path
):
self
.
get_logger
().
info
(
f
"
Current target index:
{
self
.
current_target_index
}
"
)
target_node_name
=
self
.
path
[
self
.
current_target_index
]
target_node_name
=
self
.
path
[
self
.
current_target_index
]
target_pos
=
self
.
get_node_position
(
target_node_name
)
target_pos
=
self
.
get_node_position
(
target_node_name
)
self
.
get_logger
().
info
(
f
"
Target position:
{
target_pos
}
"
)
# Publish current position
# Publish current position
position_msg
=
Point
(
x
=
self
.
current_tag1_position
[
0
],
y
=
self
.
current_tag1_position
[
1
],
z
=
0.0
)
position_msg
=
Point
(
x
=
self
.
current_tag1_position
[
0
],
y
=
self
.
current_tag1_position
[
1
],
z
=
0.0
)
self
.
start_publisher
.
publish
(
position_msg
)
self
.
start_publisher
.
publish
(
position_msg
)
self
.
get_logger
().
info
(
f
"
Current position:
{
self
.
current_tag1_position
}
Success!
"
)
# Publish target position
# Publish target position
target_msg
=
Point
(
x
=
target_pos
[
0
],
y
=
target_pos
[
1
],
z
=
0.0
)
target_msg
=
Point
(
x
=
target_pos
[
0
],
y
=
target_pos
[
1
],
z
=
0.0
)
self
.
target_location_pub
.
publish
(
target_msg
)
self
.
target_location_pub
.
publish
(
target_msg
)
self
.
get_logger
().
info
(
f
"
Target position:
{
target_pos
}
Success!
"
)
# Check if close to the node
# Check if close to the node
dist
=
math
.
sqrt
((
self
.
current_tag1_position
[
0
]
-
target_pos
[
0
])
**
2
+
dist
=
math
.
sqrt
((
self
.
current_tag1_position
[
0
]
-
target_pos
[
0
])
**
2
+
(
self
.
current_tag1_position
[
1
]
-
target_pos
[
1
])
**
2
)
(
self
.
current_tag1_position
[
1
]
-
target_pos
[
1
])
**
2
)
...
...
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