Skip to content

Commit 6adc54c

Browse files
Armant/fix local ukf (#100)
* Change to work with imu_filter_madgwick instead of mahony * Put all launch stuff in one file * fix urdf temporarily
1 parent d5f289f commit 6adc54c

File tree

5 files changed

+38
-37
lines changed

5 files changed

+38
-37
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
ukf_local:
22
ros__parameters:
33
frequency: 50.0
4-
sensor_timeout: 0.1
5-
two_d_mode: true
4+
two_d_mode: false
5+
6+
print_diagnostics: true
7+
debug: true
8+
debug_out_file: /home/arman/debug/debug_out_file.txt
69

7-
map_frame: map
810
odom_frame: odom
911
base_link_frame: base_link
1012
world_frame: odom
@@ -15,10 +17,9 @@ ukf_local:
1517
imu0: /imu/data
1618
imu0_config: [
1719
false, false, false, # position
18-
true, true, true, # orientation (Mahony)
20+
true, true, false, # orientation (Mahony)
1921
false, false, false, # velocity
2022
true, true, true, # angular velocity
21-
true, true, true # linear acceleration
23+
false, false, false # linear acceleration
2224
]
23-
2425
imu0_remove_gravitational_acceleration: false

src/localization_dev/launch/localization.launch.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@
33
from launch_ros.substitutions import FindPackageShare
44
from launch.substitutions import PathJoinSubstitution
55

6+
import os
7+
from ament_index_python.packages import get_package_share_directory
8+
from launch.actions import IncludeLaunchDescription
9+
from launch.launch_description_sources import PythonLaunchDescriptionSource
10+
611
def generate_launch_description():
712
ukf_local_yaml = PathJoinSubstitution([
813
FindPackageShare('localization_dev'),
914
'config',
1015
'ukf_local.yaml'
1116
])
12-
ukf_global_yaml = PathJoinSubstitution([
13-
FindPackageShare('localization_dev'),
14-
'config',
15-
'ukf_global.yaml'
16-
])
17-
navsat_yaml = PathJoinSubstitution([
18-
FindPackageShare('localization_dev'),
19-
'config',
20-
'navsat.yaml'
21-
])
2217
return LaunchDescription([
2318

2419
Node(
@@ -29,20 +24,22 @@ def generate_launch_description():
2924
parameters=[ukf_local_yaml],
3025
remappings=[('odometry/filtered', 'odometry/filtered')]
3126
),
32-
3327
Node(
34-
package='robot_localization',
35-
executable='navsat_transform_node',
36-
name='navsat_transform',
37-
output='screen',
38-
parameters=[navsat_yaml]
39-
),
40-
41-
Node(
42-
package='robot_localization',
43-
executable='ukf_node',
44-
name='ukf_global',
28+
package='imu_filter_madgwick',
29+
executable='imu_filter_madgwick_node',
30+
name='imu_filter',
4531
output='screen',
46-
parameters=[ukf_global_yaml]
32+
parameters=[{
33+
'publish_tf': False
34+
}]
4735
),
36+
IncludeLaunchDescription(
37+
PythonLaunchDescriptionSource(
38+
os.path.join(
39+
get_package_share_directory('phidgets_spatial'),
40+
'launch',
41+
'spatial-launch.py'
42+
)
43+
)
44+
)
4845
])

src/rover_description/launch/display_chassis.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def generate_launch_description():
5656
)
5757

5858
urdf_file_path = (
59-
get_package_share_directory("rover_description") + "/urdf/chassis_urdf_24_rviz.urdf"
59+
get_package_share_directory("rover_description") + "/urdf/Chassis_jan25.SLDASM.urdf"
6060
)
6161

6262
rviz_node = Node(

src/rover_description/launch/slam_launch.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ def generate_launch_description():
1515
"base_frame": "base_link",
1616
"scan_topic": "/scan",
1717
"mode": "mapping",
18-
"transform_tolerance": 1,
19-
"transform_cache_size": 10000,
20-
"transform_publish_period": 0.05,
21-
"min_laser_range": 0.0,
22-
"max_laser_range": 25.0
2318
}]
2419
)
2520
])

Chassis_jan25.SLDASM.urdf renamed to src/rover_description/urdf/Chassis_jan25.SLDASM.urdf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@
542542
xyz="0 0 0" />
543543
</joint>
544544
<link
545-
name="IMU">
545+
name="imu_link">
546546
<inertial>
547547
<origin
548548
xyz="0.00950000000000004 0.0125 0.00950000000000004"
@@ -590,8 +590,16 @@
590590
<parent
591591
link="base_link" />
592592
<child
593-
link="IMU" />
593+
link="imu_link" />
594594
<axis
595595
xyz="0 0 0" />
596596
</joint>
597+
<link name="lidar">
598+
</link>
599+
600+
<joint name="lidar_joint" type="fixed">
601+
<parent link="base_link" />
602+
<child link="lidar" />
603+
<origin xyz="0 0 0" rpy="0 0 0" />
604+
</joint>
597605
</robot>

0 commit comments

Comments
 (0)