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

ArUco Robot Localization #32

Merged
merged 97 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
ba7989d
added raspicam
VladimirVincan Dec 8, 2021
74d80bc
init
VladimirVincan Dec 9, 2021
8f7fafe
merge main
VladimirVincan Feb 20, 2022
99de1e0
nav2 typo fix
VladimirVincan Feb 20, 2022
6974a59
Merge branch 'main' into camera
VladimirVincan Feb 20, 2022
02bfdaf
fix nav2
VladimirVincan Feb 20, 2022
b0fa5ec
simulation_launch update for camera_central
VladimirVincan Feb 20, 2022
e8fc929
video frame received
VladimirVincan Feb 21, 2022
80f9755
added obj files. centered all objects around hinges
VladimirVincan Feb 23, 2022
bb8e3a8
pose estimation
VladimirVincan Feb 25, 2022
1268fa3
publish to tf
VladimirVincan Feb 26, 2022
8d878d6
new obj files
VladimirVincan Feb 28, 2022
b5ecc9a
finished robot
VladimirVincan Mar 1, 2022
247bc3b
added replica connector, added robot to eurobot map
VladimirVincan Mar 1, 2022
c975775
fix viewpoint
VladimirVincan Mar 1, 2022
dd591fd
merge main
VladimirVincan Mar 1, 2022
b401d8a
add extern controller
VladimirVincan Mar 1, 2022
fc75dda
working strategy
VladimirVincan Mar 1, 2022
9e02ceb
fix aruco size
VladimirVincan Mar 1, 2022
6baf935
return WaitMatchStartAction
VladimirVincan Mar 1, 2022
92097ba
bounding object fix
VladimirVincan Mar 1, 2022
f856dfd
fix metalness
VladimirVincan Mar 1, 2022
5ab6b21
fix metalness
VladimirVincan Mar 1, 2022
ed9b5c7
merge robot_update
VladimirVincan Mar 1, 2022
069379d
merge robot_update
VladimirVincan Mar 1, 2022
5aef871
change cam position. change aruco dimensions in .py file
VladimirVincan Mar 2, 2022
4b79933
orientation is correct
VladimirVincan Mar 2, 2022
453ee37
end of day commit
VladimirVincan Mar 2, 2022
1459786
Apply PR suggestion
VladimirVincan Mar 3, 2022
8863ba5
Apply PR suggestion
VladimirVincan Mar 3, 2022
5bc4cdb
linter fix
VladimirVincan Mar 3, 2022
78f6cbd
linter fix
VladimirVincan Mar 3, 2022
0ba87fe
linter copyright fix
VladimirVincan Mar 3, 2022
5b400df
remove .bak
VladimirVincan Mar 3, 2022
da76050
merge main
VladimirVincan Mar 5, 2022
d13a319
solved z axis flipping
VladimirVincan Mar 6, 2022
c091af6
camera info listener
VladimirVincan Mar 6, 2022
320e9d5
camera info listener
VladimirVincan Mar 6, 2022
f165b46
autopep8
VladimirVincan Mar 6, 2022
e37809b
autopep8
VladimirVincan Mar 6, 2022
afc3e84
trying to fix static_tf_listener
VladimirVincan Mar 6, 2022
a5bbabe
works. added launch files
VladimirVincan Mar 15, 2022
4934c9b
remove static broadcaster
VladimirVincan Mar 15, 2022
8433a64
linter fix
VladimirVincan Mar 15, 2022
9039b86
remove calibration matrix yaml
VladimirVincan Mar 15, 2022
f7f99f2
remove build in cam controller
VladimirVincan Mar 15, 2022
281d16a
remove bak file
VladimirVincan Mar 15, 2022
57c6791
revert world file
VladimirVincan Mar 15, 2022
e72382a
remove Pogon.proto
VladimirVincan Mar 15, 2022
e7074de
remove RobotMemristor.proto
VladimirVincan Mar 16, 2022
c178a31
remove empty files
VladimirVincan Mar 16, 2022
ee824f2
Merge branch 'main' into camera
VladimirVincan Mar 16, 2022
e521948
revert empty file
VladimirVincan Mar 16, 2022
df9d6fc
change webots robot env name
VladimirVincan Mar 16, 2022
dfb78de
deleted camera controller
VladimirVincan Mar 17, 2022
7cba2d5
make static cvbridge
VladimirVincan Mar 20, 2022
31e49c5
Merge branch 'main' into camera
VladimirVincan Mar 20, 2022
a98d623
Bug fix - delete the duplicate function
MarijaGolubovic Jun 29, 2022
ebcbdf5
Merge branch 'main' of github.com:memristor/mep3 into bug_fix
MarijaGolubovic Oct 7, 2022
7910a86
Adapt the playing area to a new theme
MarijaGolubovic Oct 7, 2022
cbcec47
fixed positions and orientations of walls, fixed beacon supports, cen…
VladimirVincan Oct 8, 2022
882bba0
finished first version of terrain
VladimirVincan Oct 8, 2022
e74660f
set viewpoint. reposition opponent boxes
VladimirVincan Oct 8, 2022
d3f2130
fix cherry support name warning
VladimirVincan Oct 8, 2022
2ca688f
added color plate to top of FixedBeaconSupport.proto
VladimirVincan Oct 10, 2022
7469443
Remove Statuette and Replica drivers from config urdf files and judge.py
VladimirVincan Oct 10, 2022
b1d74f6
fix initial positions of opponent robots in judge.py
VladimirVincan Oct 10, 2022
425f109
fix Webots shortcut
VladimirVincan Oct 11, 2022
05a5246
fix Webots shortcut
VladimirVincan Oct 11, 2022
fda6fdb
remove mep3_localization
VladimirVincan Oct 19, 2022
a0a9d1a
merge simulation 2023 (PROTO files still not found)
VladimirVincan Oct 19, 2022
9c79b6e
fix behavior_tree_cpp_v3 package name in CMake lists
VladimirVincan Oct 22, 2022
f4fb333
merge main
VladimirVincan Nov 5, 2022
979b388
Change WEBOTS_ROBOT_NAME to WEBOTS_CONTROLLER_URL. Add Ros2Supervisor…
VladimirVincan Nov 5, 2022
f5af5c0
finished aruco_detector.py
VladimirVincan Nov 6, 2022
4c603a3
Created pose_corrector.py
VladimirVincan Nov 8, 2022
a11197c
swap child and parent in tf2 for raw_camera
VladimirVincan Nov 8, 2022
9a20fe1
added send_raw_table_markers().
VladimirVincan Nov 9, 2022
e0ae2de
end of day commit
VladimirVincan Nov 10, 2022
9495404
Deleted PoseCorrector, RobotDetection and ObjectLocalizer. Added ever…
VladimirVincan Nov 12, 2022
da068d4
apply Darko's comments
VladimirVincan Nov 16, 2022
dd9fca7
Merge branch 'main' into camera
lukicdarkoo Nov 20, 2022
4fc1cd2
fix
lukicdarkoo Nov 20, 2022
769f352
cleanup
lukicdarkoo Nov 20, 2022
610af17
Fix error if marker_[20] is not found.
VladimirVincan Nov 21, 2022
644a892
Working on debug and use_localization options. Not finished.
VladimirVincan Nov 21, 2022
d50a066
Add use_localization and debug launch configurations. Fix Viewpoint.
VladimirVincan Nov 22, 2022
df1a24c
Change name 'cam' to 'camera' everywhere.
VladimirVincan Nov 22, 2022
3b7d464
Fix color of robots. purple->green and yellow->blue.
VladimirVincan Nov 22, 2022
8717652
Fix check_alignment().
VladimirVincan Nov 22, 2022
53fb256
Add debug mode to aruco_detector.py
VladimirVincan Nov 22, 2022
7c9fbb4
Make all functions and variables private.
VladimirVincan Nov 22, 2022
eaf5ff5
Change transformation_matrix to tmat.
VladimirVincan Nov 22, 2022
3de8d60
delete flycheck
VladimirVincan Nov 22, 2022
7e95339
Remove word listen from callback function names.
VladimirVincan Nov 22, 2022
77658cf
Delete tf_base_link_laser from simulation_launch.py
VladimirVincan Nov 22, 2022
00bc2c3
Static__tf_listener() -> __static_tf_callback() in description
VladimirVincan Nov 23, 2022
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
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.vscode/settings.json
.idea/
build/
install/
log/
**.pyc
mep3_simulation/COLCON_IGNORE
*.pyc
*.swp
*declare_externproto.py
mep3_simulation/webots_data/worlds/.eurobot_2023.jpg
3 changes: 3 additions & 0 deletions docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y \
ros-humble-laser-filters \
ros-humble-domain-bridge \
ros-humble-rmw-cyclonedds-cpp \
python3-pip \
python3-pil \
alsa \
libxshmfence1 \
Expand Down Expand Up @@ -54,6 +55,8 @@ RUN curl -L -o /tmp/webots.deb \
rm -f /tmp/webots.deb && \
mkdir -p /memristor/.config/Cyberbotics

RUN python3 -m pip install scipy transforms3d

# User config
COPY config/bashrc /tmp/bashrc
COPY ./config/vscode/. /memristor/ros2_ws/.vscode/
Expand Down
45 changes: 27 additions & 18 deletions mep3_bringup/launch/simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
import launch
from launch.actions import IncludeLaunchDescription
from launch.actions.set_environment_variable import SetEnvironmentVariable
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration


def generate_launch_description():
use_behavior_tree = LaunchConfiguration('bt', default=True)
big_strategy = LaunchConfiguration('big_strategy', default='purple_strategy')
small_strategy = LaunchConfiguration('small_strategy', default='purple_strategy')
big_strategy = LaunchConfiguration('big_strategy',
default='purple_strategy')
small_strategy = LaunchConfiguration('small_strategy',
default='purple_strategy')
color = LaunchConfiguration('color', default='purple')
use_opponents = LaunchConfiguration('opponents', default=False)
namespace = LaunchConfiguration('namespace', default='big')
debug = LaunchConfiguration('debug', default=False)
use_localization = LaunchConfiguration('localization', default=False)

set_color_action = SetEnvironmentVariable('MEP3_COLOR', color)
set_use_opponents = SetEnvironmentVariable('MEP3_OPPONENTS', use_opponents)

simulation = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(
get_package_share_directory('mep3_simulation'),
'launch',
'simulation_launch.py'
)),
)
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('mep3_simulation'),
'launch', 'simulation_launch.py')),)

big_robot = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(
get_package_share_directory('mep3_bringup'),
'launch',
'robot_launch.py'
)),
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('mep3_bringup'), 'launch',
'robot_launch.py')),
launch_arguments=[
('sim', 'true'),
('namespace', namespace),
Expand All @@ -46,11 +46,9 @@ def generate_launch_description():
)

small_robot = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(
get_package_share_directory('mep3_bringup'),
'launch',
'robot_launch.py'
)),
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('mep3_bringup'), 'launch',
'robot_launch.py')),
launch_arguments=[
('sim', 'true'),
('namespace', 'small'),
Expand All @@ -60,12 +58,23 @@ def generate_launch_description():
],
)

localization = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('mep3_localization'),
'launch', 'localization_launch.py')),
launch_arguments=[
('debug', debug),
],
condition=IfCondition(use_localization),
)

return launch.LaunchDescription([
big_robot,
small_robot,

# The easiest way to get pass variables to Webots controllers
# is to use environment variables.
localization,
set_color_action,
set_use_opponents,
simulation,
Expand Down
70 changes: 70 additions & 0 deletions mep3_localization/launch/localization_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env python3

# Copyright 2022 Memristor Robotics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, PythonExpression


def generate_launch_description():
"""
It is necessary to have a prediction of the camera position
in order to detect incorrect orientations of ArUco markers.

Debug launch parameter is used to publish static marker positions.
"""
debug = LaunchConfiguration('debug', default=False)

return LaunchDescription([
Node(package='tf2_ros',
executable='static_transform_publisher',
arguments=[
'-0.1', '1.50976', '1.05','-4.85921e-06', '-0.965927', '0.258816', '1.32679e-06', 'map', 'camera_prediction'
],
condition = IfCondition(debug)),
Node(package='tf2_ros',
executable='static_transform_publisher',
arguments=[
'-0.430', '0.925', '0', '0', '0', '0', '1', 'map', 'marker_[20]_static'
],
condition = IfCondition(debug)),
Node(package='tf2_ros',
executable='static_transform_publisher',
arguments=[
'0.430', '0.925', '0', '0', '0', '0', '1', 'map', 'marker_[21]_static',
],
condition = IfCondition(debug)),
Node(package='tf2_ros',
executable='static_transform_publisher',
arguments=[
'-0.430', '-0.925', '0', '0', '0', '0', '1', 'map', 'marker_[22]_static',
],
condition = IfCondition(debug)),
Node(package='tf2_ros',
executable='static_transform_publisher',
arguments=[
'0.430', '-0.925', '0', '0', '0', '0', '1', 'map', 'marker_[23]_static',
],
condition = IfCondition(debug)),
Node(package='mep3_localization', executable='aruco_detector',
output='screen', # debugging
emulate_tty=True, # debugging
parameters=[
{'debug': debug}
]
),
])
Empty file.
Loading