Skip to content

Commit a2bacb6

Browse files
Feature/aruco bt (#65)
* Added Aruco Marker 0 model * Fixed model.config * Added normal camera to URDF * Add Bounding Box (BB) msg for Aruco detection * Fixed import path for BB msg * Added BB to CMakeLists so the interface is generated * Fixed ArUco marker image, previous one wasn't 4x4 50 * Fixed aruco_node OpenCV version issues, added support for sim parameter * Changed BB to Detection 2D * Added ROS gz bridge for camera * Slightly increase forward speed when aruco isn't detecte * In progress: Added cpp aruco node that publishes aruco pose in map frame, working on BT stuff * Fixed aruco pose estimation * Made aruco goal pose same orientation as rover currently * Changed info messages to warning * Added archimedean spiral path coverage * Cleaned up BT, fixed spiral generation to start at actual rover position, fixed stale aruco pose issue * Changed default nav mode back to GNSS * Get rid of old camera * Fixed sime time vs real time issue, made spiral path start align with current rover orientation * Changed sim parameter to use_sim_time * Added GNSS navigation to aruco branch * Oops forgot to switch default to GNSS * Added sim transform for rgb camera * Moved aruco launch to navigation launch * Removed unnecessary aruco sdfs
1 parent 15deaff commit a2bacb6

25 files changed

Lines changed: 1111 additions & 64 deletions
318 Bytes
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:12d843202591af4ace325c6d3c998c72d31ad3e37f4eb9b5300964c2748e4e8e
3+
size 5637
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
3+
<model>
4+
<name>Marker0</name>
5+
<version>1.0</version>
6+
<sdf version="1.6">model.sdf</sdf>
7+
8+
<author>
9+
<name>Mikael Arguedas</name>
10+
<email>mikael.arguedas@gmail.com</email>
11+
</author>
12+
13+
<description>
14+
ArUco Marker 0 (4x4), generated with code from https://github.com/AD-lite24/aruco_in_gazebo.
15+
Modified by Abhinav Kota (abhinav.kota06@gmail.com)
16+
</description>
17+
18+
</model>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" ?>
2+
<sdf version="1.6">
3+
<model name="Marker0">
4+
<static>true</static>
5+
<link name="link">
6+
<visual name="visual">
7+
<geometry>
8+
<mesh>
9+
<uri>model://marker0/meshes/Marker0.dae</uri>
10+
</mesh>
11+
</geometry>
12+
</visual>
13+
</link>
14+
</model>
15+
</sdf>

src/description/urdf/zed_macro_sim.urdf.xacro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
<parent link="${name}_left_camera_frame"/>
4848
<child link="${name}_left_camera_frame_optical"/>
4949
</joint>
50+
51+
<link name="athena/base_footprint/${name}_rgb_sensor"/>
52+
<joint name="${name}_rgb_sensor_joint" type="fixed">
53+
<origin xyz="0 0 0" rpy="-${M_PI/2} 0.0 -${M_PI/2}"/>
54+
<parent link="${name}_left_camera_frame"/>
55+
<child link="athena/base_footprint/${name}_rgb_sensor"/>
56+
</joint>
5057

5158
<link name="${name}_right_camera_frame" />
5259
<joint name="${name}_right_camera_joint" type="fixed">

src/simulation/launch/bridge.launch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ def generate_launch_description():
2424
output='screen',
2525
arguments=[
2626
'/zed/zed_node/left/image_rect_color@sensor_msgs/msg/Image@gz.msgs.Image',
27+
'/zed/zed_node/left/camera_info@sensor_msgs/msg/CameraInfo@gz.msgs.CameraInfo'
2728
],
2829
),
29-
30+
3031
Node(
3132
package='ros_gz_bridge',
3233
executable='parameter_bridge',

src/simulation/launch/bringup.launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,5 @@ def generate_launch_description():
9898
ld.add_action(bridge)
9999
ld.add_action(control)
100100
ld.add_action(ground_truth_tf)
101+
101102
return ld
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(aruco_bt)
3+
4+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5+
add_compile_options(-Wall -Wextra -Wpedantic)
6+
endif()
7+
8+
# find dependencies
9+
find_package(ament_cmake REQUIRED)
10+
find_package(rclcpp REQUIRED)
11+
find_package(sensor_msgs REQUIRED)
12+
find_package(geometry_msgs REQUIRED)
13+
find_package(cv_bridge REQUIRED)
14+
find_package(OpenCV REQUIRED)
15+
find_package(tf2_ros REQUIRED)
16+
find_package(tf2_geometry_msgs REQUIRED)
17+
18+
# Add executable
19+
add_executable(aruco_node src/aruco_node.cpp)
20+
21+
# Include directories
22+
target_include_directories(aruco_node PUBLIC
23+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
24+
$<INSTALL_INTERFACE:include>)
25+
26+
# Link dependencies
27+
ament_target_dependencies(aruco_node
28+
rclcpp
29+
sensor_msgs
30+
geometry_msgs
31+
cv_bridge
32+
OpenCV
33+
tf2_ros
34+
tf2_geometry_msgs)
35+
36+
target_compile_features(aruco_node PUBLIC c_std_99 cxx_std_17)
37+
38+
# Install targets
39+
install(TARGETS aruco_node
40+
DESTINATION lib/${PROJECT_NAME})
41+
42+
install(DIRECTORY launch/
43+
DESTINATION share/${PROJECT_NAME}/launch)
44+
45+
if(BUILD_TESTING)
46+
find_package(ament_lint_auto REQUIRED)
47+
48+
set(ament_cmake_copyright_FOUND TRUE)
49+
50+
set(ament_cmake_cpplint_FOUND TRUE)
51+
ament_lint_auto_find_test_dependencies()
52+
endif()
53+
54+
ament_package()
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from launch import LaunchDescription
2+
from launch.actions import DeclareLaunchArgument
3+
from launch.substitutions import LaunchConfiguration
4+
from launch_ros.actions import Node
5+
6+
ARGUMENTS = [
7+
DeclareLaunchArgument(
8+
'marker_size',
9+
default_value='0.2',
10+
description='Size of ArUco marker in meters'
11+
),
12+
]
13+
14+
def generate_launch_description():
15+
aruco_node = Node(
16+
package='aruco_bt',
17+
executable='aruco_node',
18+
name='aruco_node',
19+
parameters=[
20+
{'use_sim_time': LaunchConfiguration('use_sim_time')},
21+
{'marker_size': LaunchConfiguration('marker_size')}
22+
],
23+
output='screen'
24+
)
25+
26+
ld = LaunchDescription(ARGUMENTS)
27+
ld.add_action(aruco_node)
28+
29+
return ld
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>aruco_bt</name>
5+
<version>0.0.0</version>
6+
<description>C++ package for aruco detection and pose estimation</description>
7+
<maintainer email="abhinav.kota06@gmail.com">abhinavkota06</maintainer>
8+
<license>TODO: License declaration</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
12+
<depend>rclcpp</depend>
13+
<depend>sensor_msgs</depend>
14+
<depend>geometry_msgs</depend>
15+
<depend>cv_bridge</depend>
16+
<depend>OpenCV</depend>
17+
<depend>tf2_ros</depend>
18+
<depend>tf2_geometry_msgs</depend>
19+
20+
21+
<test_depend>ament_lint_auto</test_depend>
22+
<test_depend>ament_lint_common</test_depend>
23+
24+
<export>
25+
<build_type>ament_cmake</build_type>
26+
</export>
27+
</package>

0 commit comments

Comments
 (0)