Skip to content

Commit cb800b7

Browse files
omertsnakai-omerSteveMacenski
authored
Fix configuration issues (#57)
* Fix configuration issues * Update sam_bot_description/launch/display.launch.py Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: Omer Spalter <omers@nakairobotics.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
1 parent 5440ca4 commit cb800b7

File tree

3 files changed

+80
-67
lines changed

3 files changed

+80
-67
lines changed

sam_bot_description/config/nav2_params.yaml

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bt_navigator:
5252
use_sim_time: True
5353
global_frame: map
5454
robot_base_frame: base_link
55-
odom_topic: /odom
55+
odom_topic: /demo/odom
5656
bt_loop_duration: 10
5757
default_server_timeout: 20
5858
enable_groot_monitoring: True
@@ -63,37 +63,37 @@ bt_navigator:
6363
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
6464
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
6565
plugin_lib_names:
66-
- nav2_compute_path_to_pose_action_bt_node
67-
- nav2_compute_path_through_poses_action_bt_node
68-
- nav2_follow_path_action_bt_node
69-
- nav2_back_up_action_bt_node
70-
- nav2_spin_action_bt_node
71-
- nav2_wait_action_bt_node
72-
- nav2_clear_costmap_service_bt_node
73-
- nav2_is_stuck_condition_bt_node
74-
- nav2_goal_reached_condition_bt_node
75-
- nav2_goal_updated_condition_bt_node
76-
- nav2_initial_pose_received_condition_bt_node
77-
- nav2_reinitialize_global_localization_service_bt_node
78-
- nav2_rate_controller_bt_node
79-
- nav2_distance_controller_bt_node
80-
- nav2_speed_controller_bt_node
81-
- nav2_truncate_path_action_bt_node
82-
- nav2_goal_updater_node_bt_node
83-
- nav2_recovery_node_bt_node
84-
- nav2_pipeline_sequence_bt_node
85-
- nav2_round_robin_node_bt_node
86-
- nav2_transform_available_condition_bt_node
87-
- nav2_time_expired_condition_bt_node
88-
- nav2_distance_traveled_condition_bt_node
89-
- nav2_single_trigger_bt_node
90-
- nav2_is_battery_low_condition_bt_node
91-
- nav2_navigate_through_poses_action_bt_node
92-
- nav2_navigate_to_pose_action_bt_node
93-
- nav2_remove_passed_goals_action_bt_node
94-
- nav2_planner_selector_bt_node
95-
- nav2_controller_selector_bt_node
96-
- nav2_goal_checker_selector_bt_node
66+
- nav2_compute_path_to_pose_action_bt_node
67+
- nav2_compute_path_through_poses_action_bt_node
68+
- nav2_follow_path_action_bt_node
69+
- nav2_back_up_action_bt_node
70+
- nav2_spin_action_bt_node
71+
- nav2_wait_action_bt_node
72+
- nav2_clear_costmap_service_bt_node
73+
- nav2_is_stuck_condition_bt_node
74+
- nav2_goal_reached_condition_bt_node
75+
- nav2_goal_updated_condition_bt_node
76+
- nav2_initial_pose_received_condition_bt_node
77+
- nav2_reinitialize_global_localization_service_bt_node
78+
- nav2_rate_controller_bt_node
79+
- nav2_distance_controller_bt_node
80+
- nav2_speed_controller_bt_node
81+
- nav2_truncate_path_action_bt_node
82+
- nav2_goal_updater_node_bt_node
83+
- nav2_recovery_node_bt_node
84+
- nav2_pipeline_sequence_bt_node
85+
- nav2_round_robin_node_bt_node
86+
- nav2_transform_available_condition_bt_node
87+
- nav2_time_expired_condition_bt_node
88+
- nav2_distance_traveled_condition_bt_node
89+
- nav2_single_trigger_bt_node
90+
- nav2_is_battery_low_condition_bt_node
91+
- nav2_navigate_through_poses_action_bt_node
92+
- nav2_navigate_to_pose_action_bt_node
93+
- nav2_remove_passed_goals_action_bt_node
94+
- nav2_planner_selector_bt_node
95+
- nav2_controller_selector_bt_node
96+
- nav2_goal_checker_selector_bt_node
9797

9898
bt_navigator_rclcpp_node:
9999
ros__parameters:
@@ -110,6 +110,7 @@ controller_server:
110110
progress_checker_plugin: "progress_checker"
111111
goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
112112
controller_plugins: ["FollowPath"]
113+
odom_topic: /demo/odom
113114

114115
# Progress checker parameters
115116
progress_checker:
@@ -158,7 +159,16 @@ controller_server:
158159
trans_stopped_velocity: 0.25
159160
short_circuit_trajectory_evaluation: True
160161
stateful: True
161-
critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
162+
critics:
163+
[
164+
"RotateToGoal",
165+
"Oscillation",
166+
"BaseObstacle",
167+
"GoalAlign",
168+
"PathAlign",
169+
"PathDist",
170+
"GoalDist",
171+
]
162172
BaseObstacle.scale: 0.02
163173
PathAlign.scale: 32.0
164174
PathAlign.forward_point_distance: 0.1
@@ -169,7 +179,7 @@ controller_server:
169179
RotateToGoal.scale: 32.0
170180
RotateToGoal.slowing_factor: 5.0
171181
RotateToGoal.lookahead_time: -1.0
172-
182+
173183
controller_server_rclcpp_node:
174184
ros__parameters:
175185
use_sim_time: True
@@ -320,8 +330,8 @@ waypoint_follower:
320330
ros__parameters:
321331
loop_rate: 20
322332
stop_on_failure: false
323-
waypoint_task_executor_plugin: "wait_at_waypoint"
333+
waypoint_task_executor_plugin: "wait_at_waypoint"
324334
wait_at_waypoint:
325335
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
326336
enabled: True
327-
waypoint_pause_duration: 200
337+
waypoint_pause_duration: 200

sam_bot_description/launch/display.launch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ def generate_launch_description():
1212
robot_state_publisher_node = launch_ros.actions.Node(
1313
package='robot_state_publisher',
1414
executable='robot_state_publisher',
15-
parameters=[{'robot_description': Command(['xacro ', LaunchConfiguration('model')])}]
15+
parameters=[{'robot_description': Command(['xacro ', LaunchConfiguration('model')])}, {'use_sim_time': LaunchConfiguration('use_sim_time')}]
1616
)
1717
joint_state_publisher_node = launch_ros.actions.Node(
1818
package='joint_state_publisher',
1919
executable='joint_state_publisher',
2020
name='joint_state_publisher',
21-
condition=launch.conditions.UnlessCondition(LaunchConfiguration('gui'))
21+
condition=launch.conditions.UnlessCondition(LaunchConfiguration('gui')),
22+
parameters=[{'use_sim_time': LaunchConfiguration('use_sim_time')}]
2223
)
2324
rviz_node = launch_ros.actions.Node(
2425
package='rviz2',

sam_bot_description/src/description/sam_bot_description.urdf

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0"?>
2-
<robot name="sam_bot" xmlns:xacro="http://ros.org/wiki/xacro">
2+
<robot name="sam_bot"
3+
xmlns:xacro="http://ros.org/wiki/xacro">
34

45
<!-- Define robot constants -->
56
<xacro:property name="base_width" value="0.31"/>
@@ -17,17 +18,17 @@
1718
<!-- Define some commonly used intertial properties -->
1819
<xacro:macro name="box_inertia" params="m w h d">
1920
<inertial>
20-
<origin xyz="0 0 0" rpy="${pi/2} 0 ${pi/2}"/>
21+
<origin xyz="0 0 0" rpy="${pi/2} 0 ${pi/2}"/>
2122
<mass value="${m}"/>
2223
<inertia ixx="${(m/12) * (h*h + d*d)}" ixy="0.0" ixz="0.0" iyy="${(m/12) * (w*w + d*d)}" iyz="0.0" izz="${(m/12) * (w*w + h*h)}"/>
2324
</inertial>
2425
</xacro:macro>
2526

2627
<xacro:macro name="cylinder_inertia" params="m r h">
2728
<inertial>
28-
<origin xyz="0 0 0" rpy="${pi/2} 0 0" />
29+
<origin xyz="0 0 0" rpy="${pi/2} 0 0" />
2930
<mass value="${m}"/>
30-
<inertia ixx="${(m/12) * (3*r*r + h*h)}" ixy = "0" ixz = "0" iyy="${(m/12) * (3*r*r + h*h)}" iyz = "0" izz="${(m/2) * (r*r)}"/>
31+
<inertia ixx="${(m/12) * (3*r*r + h*h)}" ixy = "0" ixz = "0" iyy="${(m/12) * (3*r*r + h*h)}" iyz = "0" izz="${(m/2) * (r*r)}"/>
3132
</inertial>
3233
</xacro:macro>
3334

@@ -37,7 +38,7 @@
3738
<inertia ixx="${(2/5) * m * (r*r)}" ixy="0.0" ixz="0.0" iyy="${(2/5) * m * (r*r)}" iyz="0.0" izz="${(2/5) * m * (r*r)}"/>
3839
</inertial>
3940
</xacro:macro>
40-
41+
4142
<!-- Robot Base -->
4243
<link name="base_link">
4344
<visual>
@@ -57,10 +58,10 @@
5758

5859
<xacro:box_inertia m="15" w="${base_width}" d="${base_length}" h="${base_height}"/>
5960
</link>
60-
61-
<!-- Robot Footprint -->
61+
62+
<!-- Robot Footprint -->
6263
<link name="base_footprint">
63-
<xacro:box_inertia m="0" w="0" d="0" h="0"/>
64+
<xacro:box_inertia m="0" w="0" d="0" h="0"/>
6465
</link>
6566

6667
<joint name="base_joint" type="fixed">
@@ -75,15 +76,15 @@
7576
<visual>
7677
<origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
7778
<geometry>
78-
<cylinder radius="${wheel_radius}" length="${wheel_width}"/>
79+
<cylinder radius="${wheel_radius}" length="${wheel_width}"/>
7980
</geometry>
8081
<material name="Gray">
8182
<color rgba="0.5 0.5 0.5 1.0"/>
8283
</material>
8384
</visual>
8485

8586
<collision>
86-
<origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
87+
<origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
8788
<geometry>
8889
<cylinder radius="${wheel_radius}" length="${wheel_width}"/>
8990
</geometry>
@@ -135,22 +136,22 @@
135136
<box size="0.1 0.1 0.1"/>
136137
</geometry>
137138
</visual>
138-
139+
139140
<collision>
140141
<geometry>
141142
<box size="0.1 0.1 0.1"/>
142143
</geometry>
143144
</collision>
144-
145+
145146
<xacro:box_inertia m="0.1" w="0.1" d="0.1" h="0.1"/>
146147
</link>
147-
148+
148149
<joint name="imu_joint" type="fixed">
149150
<parent link="base_link"/>
150151
<child link="imu_link"/>
151152
<origin xyz="0 0 0.01"/>
152153
</joint>
153-
154+
154155
<gazebo reference="imu_link">
155156
<sensor name="imu_sensor" type="imu">
156157
<plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
@@ -163,10 +164,10 @@
163164
<always_on>true</always_on>
164165
<update_rate>100</update_rate>
165166
<visualize>true</visualize>
166-
<imu>
167-
<angular_velocity>
168-
<x>
169-
<noise type="gaussian">
167+
<imu>
168+
<angular_velocity>
169+
<x>
170+
<noise type="gaussian">
170171
<mean>0.0</mean>
171172
<stddev>2e-4</stddev>
172173
<bias_mean>0.0000075</bias_mean>
@@ -219,11 +220,12 @@
219220
</imu>
220221
</sensor>
221222
</gazebo>
222-
223+
223224
<gazebo>
224225
<plugin name='diff_drive' filename='libgazebo_ros_diff_drive.so'>
225226
<ros>
226227
<namespace>/demo</namespace>
228+
<remap from="cmd_vel" to="/cmd_vel"/>
227229
</ros>
228230

229231
<!-- wheels -->
@@ -234,7 +236,7 @@
234236
<wheel_separation>0.4</wheel_separation>
235237
<wheel_diameter>0.2</wheel_diameter>
236238

237-
<!-- limits -->
239+
<!-- limits -->
238240
<max_wheel_torque>20</max_wheel_torque>
239241
<max_wheel_acceleration>1.0</max_wheel_acceleration>
240242

@@ -248,34 +250,34 @@
248250
</plugin>
249251
</gazebo>
250252

251-
<link name="lidar_link">
253+
<link name="lidar_link">
252254
<inertial>
253255
<origin xyz="0 0 0" rpy="0 0 0"/>
254256
<mass value="0.125"/>
255-
<inertia ixx="0.001" ixy="0" ixz="0" iyy="0.001" iyz="0" izz="0.001" />
257+
<inertia ixx="0.001" ixy="0" ixz="0" iyy="0.001" iyz="0" izz="0.001" />
256258
</inertial>
257259

258260
<collision>
259261
<origin xyz="0 0 0" rpy="0 0 0"/>
260262
<geometry>
261-
<cylinder radius="0.0508" length="0.055"/>
263+
<cylinder radius="0.0508" length="0.055"/>
262264
</geometry>
263265
</collision>
264266

265267
<visual>
266268
<origin xyz="0 0 0" rpy="0 0 0"/>
267269
<geometry>
268-
<cylinder radius="0.0508" length="0.055"/>
270+
<cylinder radius="0.0508" length="0.055"/>
269271
</geometry>
270272
</visual>
271273
</link>
272-
274+
273275
<joint name="lidar_joint" type="fixed">
274276
<parent link="base_link"/>
275277
<child link="lidar_link"/>
276278
<origin xyz="0 0 0.12" rpy="0 0 0"/>
277279
</joint>
278-
280+
279281
<gazebo reference="lidar_link">
280282
<sensor name="lidar" type="ray">
281283
<always_on>true</always_on>
@@ -310,7 +312,7 @@
310312
</plugin>
311313
</sensor>
312314
</gazebo>
313-
315+
314316
<link name="camera_link">
315317
<visual>
316318
<origin xyz="0 0 0" rpy="0 0 0"/>
@@ -329,10 +331,10 @@
329331
<inertial>
330332
<origin xyz="0 0 0" rpy="0 0 0"/>
331333
<mass value="0.035"/>
332-
<inertia ixx="0.001" ixy="0" ixz="0" iyy="0.001" iyz="0" izz="0.001" />
334+
<inertia ixx="0.001" ixy="0" ixz="0" iyy="0.001" iyz="0" izz="0.001" />
333335
</inertial>
334336
</link>
335-
337+
336338
<joint name="camera_joint" type="fixed">
337339
<parent link="base_link"/>
338340
<child link="camera_link"/>

0 commit comments

Comments
 (0)