ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

vrichard's profile - activity

2023-10-03 14:59:40 -0500 received badge  Famous Question (source)
2022-12-20 07:45:01 -0500 received badge  Famous Question (source)
2022-10-20 04:33:15 -0500 received badge  Notable Question (source)
2022-09-13 01:38:34 -0500 received badge  Popular Question (source)
2022-09-10 23:23:57 -0500 received badge  Rapid Responder (source)
2022-09-10 23:23:57 -0500 answered a question how to specify launch argument type in ros2 launch command?

@shonigmann was close to the actual answer. It is possible to force the value to be intepreted as string by surrounding

2022-09-10 23:17:12 -0500 commented answer how to specify launch argument type in ros2 launch command?

Thank you for the feedback. Surrounding the pair with quotes does not change anything. The 12345 value is still interpre

2022-09-10 23:17:01 -0500 commented answer how to specify launch argument type in ros2 launch command?

Thank you for the feedback. Surrounding the pair with quotes does not change anything. the 12345 value is still interpre

2022-09-10 23:15:39 -0500 edited question how to specify launch argument type in ros2 launch command?

how to specify launch argument type in ros2 launch command? I have a ROS2 node which takes a 'username' string argument.

2022-09-10 22:55:44 -0500 marked best answer how to specify launch argument type in ros2 launch command?

I have a ROS2 node which takes a 'username' string argument. I can normally run the node like this:

ros2 launch my_pkg launch.py username:=XXX

In my case, my username is composed of digits only, like so:

ros2 launch my_pkg launch.py username:=12345

The issue then is that ros2 launch fails because:

 rclpy.exceptions.InvalidParameterTypeException: Trying to set parameter 'username' to '12345' of type 'INTEGER', expecting type 'STRING'

surrounding 12345 with quotes like "12345" or '12345' does not help. How can I tell ROS my argument is a String and not an integer?

This can be reproduced with this node: https://github.com/LORD-MicroStrain/n...

$ ros2 launch ntrip_client ntrip_client_launch.py username:=12345
[INFO] [launch]: All log files can be found below /home/vrichard/.ros/log/2022-09-11-13-05-38-795894-vr-desktop-702025
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ntrip_ros.py-1]: process started with pid [702095]
[ntrip_ros.py-1] Traceback (most recent call last):
[ntrip_ros.py-1]   File "/home/vrichard/test/install/ntrip_client/lib/ntrip_client/ntrip_ros.py", line 153, in <module>
[ntrip_ros.py-1]     node = NTRIPRos()
[ntrip_ros.py-1]   File "/home/vrichard/test/install/ntrip_client/lib/ntrip_client/ntrip_ros.py", line 26, in __init__
[ntrip_ros.py-1]     self.declare_parameters(
[ntrip_ros.py-1]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/node.py", line 491, in declare_parameters
[ntrip_ros.py-1]     self._set_parameters(
[ntrip_ros.py-1]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/node.py", line 736, in _set_parameters
[ntrip_ros.py-1]     raise InvalidParameterTypeException(
[ntrip_ros.py-1] rclpy.exceptions.InvalidParameterTypeException: Trying to set parameter 'username' to '12345' of type 'INTEGER', expecting type 'STRING'
[ERROR] [ntrip_ros.py-1]: process has died [pid 702095, exit code 1, cmd '/home/vrichard/test/install/ntrip_client/lib/ntrip_client/ntrip_ros.py --ros-args -r __node:=ntrip_client_node -r __ns:=/ntrip_client --params-file /tmp/launch_params_cmiltczq'].

I don't think the launch file is doing any weird thing. The 'username' parameter is just declared with a default string value: https://github.com/LORD-MicroStrain/n...

2022-09-10 22:52:19 -0500 received badge  Notable Question (source)
2022-09-09 01:45:57 -0500 edited question how to specify launch argument type in ros2 launch command?

how to set launch argument type? I have a ROS2 node which takes a 'username' string argument. I can normally run the nod

2022-09-09 01:45:36 -0500 asked a question how to specify launch argument type in ros2 launch command?

how to set launch argument type? I have a ROS2 node which takes a 'username' string argument. I can normally run the nod

2022-09-09 01:44:51 -0500 asked a question how to set launch argument type in ros2 launch command?

how to set launch argument type in ros2 launch command? I have a ROS2 node which takes a 'username' string argument. I c

2022-08-15 03:55:50 -0500 received badge  Notable Question (source)
2022-08-14 20:34:52 -0500 received badge  Notable Question (source)
2022-08-14 20:34:52 -0500 received badge  Popular Question (source)
2022-08-14 07:31:44 -0500 received badge  Famous Question (source)
2022-08-04 04:03:24 -0500 received badge  Popular Question (source)
2022-08-04 04:03:24 -0500 received badge  Notable Question (source)
2022-08-04 04:03:24 -0500 received badge  Famous Question (source)
2022-07-15 06:28:35 -0500 received badge  Popular Question (source)
2022-06-27 19:19:04 -0500 received badge  Nice Question (source)
2022-06-27 04:09:12 -0500 received badge  Self-Learner (source)
2022-06-23 03:52:41 -0500 marked best answer Load yaml parameters conditionally in python launch file

I would like to use a launch parameter to decide whether to load a yaml file, or chose which yaml to load if I have many configuration

For example in ROS1 it would be possible to write something like this:

<arg name="load_config_X" default="true"/>
<arg name="config_type" default="config_A"/>    

<node ...>
    <rosparam if="$(eval arg('load_config_X') == True)" command="load" file="..." />
    <rosparam if="$(eval arg('config_type') == 'config_A') " command="load" file="..." />
    <rosparam if="$(eval arg('config_type') == 'config_B') " command="load" file="..." />
</node>

Is there any equivalent to this in ROS2 python files?

load_config_X = DeclareLaunchArgument("load_config_X", default_value=False)
config_type = DeclareLaunchArgument("config_type", default_value='config_A')

my_node = Node(
    package='my_pkg',
    name='my_node',
    executable='my_node',
    parameters=[
         # ???
         # os.path.join('path', 'to', 'config_X.yaml'),
         # os.path.join('path', 'to', 'config_A.yaml'),
    ]
)
2022-06-23 03:52:35 -0500 commented answer Load yaml parameters conditionally in python launch file

Although it works, the solution is quickly cumbersome. A better approach is to use OpaqueFunction like here and .perform

2022-06-23 03:27:48 -0500 received badge  Critic (source)
2022-06-22 20:26:40 -0500 received badge  Rapid Responder (source)
2022-06-22 20:26:40 -0500 answered a question Load yaml parameters conditionally in python launch file

Found my way in the launch/launch_ros source code: For example it is possible to switch between 2 configs A/B with SetL

2022-06-22 09:45:30 -0500 asked a question Load yaml parameters conditionally in python launch file

Load yaml parameters conditionally in python launch file I would like to use a launch parameter to decide whether to loa

2022-05-11 03:47:18 -0500 received badge  Popular Question (source)
2022-01-07 13:53:21 -0500 received badge  Nice Question (source)
2021-11-10 00:25:50 -0500 edited question teb_local_planner keeps pushing the vehicle turning point toward start position during optimization

teb_local_planner keeps pushing the vehicle turning point toward start position during optimization I am using a slightl

2021-11-09 23:58:58 -0500 edited question teb_local_planner keeps pushing the vehicle turning point toward start position during optimization

teb_local_planner keeps pushing the vehicle turning point toward start position during optimization I am using a slightl

2021-11-09 23:36:46 -0500 asked a question teb_local_planner keeps pushing the vehicle turning point toward start position during optimization

teb_local_planner keeps pushing the vehicle turning point toward start position during optimization I am using a slightl

2021-11-04 03:14:30 -0500 edited question how to use custom via_points in teb_local_planner?

how to use custom via_points in teb_local_planner? I am running teb_local_planner in simulation for a carlike robot. I

2021-11-03 20:51:54 -0500 received badge  Commentator
2021-11-03 20:51:54 -0500 commented question how to use custom via_points in teb_local_planner?

Thank you! I'll check move base flex

2021-11-03 19:32:50 -0500 asked a question how to use custom via_points in teb_local_planner?

how to use custom via_points in teb_local_planner? I am running teb_local_planner in simulation for a carlike robot. I

2021-10-20 23:48:27 -0500 marked best answer prevent teb_local_planner from getting stuck while turning around obstacle (carlike)

I am running teb_local_planner in simulation for a carlike robot. Quite often I see teb_local_planner getting stuck while trying to turn around an obstacle. I guess this is because during the path generation/selection teb_local_planner thinks this path is totally fine, but right before sending the command it realizes the car actually cannot follow the path without getting too close to the obstacle

Here an example where the car is trying to do a 2 point turn to destination but stops close to the wall because the paths is not good, yet it cannot find any better path and simply waits here endlessly.:

image description

image description

I have tried to increase the size of the footprint in teb_local_planner (two_circles) so it is always bigger than the actual vehicle, but still the planner generates and selects paths that ends up being impossible.

What parameter could I adjust to solve this behavior? (reducing min_obstacle_dist is obviously not a solution)

EDIT: my teb_local_planner config:

acc_lim_theta: 0.5
acc_lim_x: 0.5
acc_lim_y: 0.5
allow_init_with_backwards_motion: true
cmd_angle_instead_rotvel: true
complete_global_plan: true
costmap_converter:
  CostmapToPolygonsDBSConcaveHull:
    cluster_max_distance: 2.0
    cluster_max_pts: 200
    cluster_min_pts: 2
    concave_hull_depth: 10.0
    convex_hull_min_pt_separation: 0.5
    min_support_pts: 2
    ransac_convert_outlier_pts: true
    ransac_filter_remaining_outlier_pts: false
    ransac_inlier_distance: 1.0
    ransac_min_inliers: 10
    ransac_no_iterations: 2000
    ransac_remainig_outliers: 3
    support_pts_max_dist: 3.0
    support_pts_max_dist_inbetween: 6.0
costmap_converter_plugin: costmap_converter::CostmapToPolygonsDBSConcaveHull
costmap_converter_rate: 5
costmap_converter_spin_thread: true
costmap_obstacles_behind_robot_dist: 5.0
delete_detours_backwards: false
divergence_detection_enable: false
divergence_detection_max_chi_squared: 10.0
dt_hysteresis: 0.1
dt_ref: 0.3
dynamic_obstacle_inflation_dist: 8.0
enable_homotopy_class_planning: true
enable_multithreading: true
exact_arc_length: false
feasibility_check_no_poses: 5
footprint_model:
  front_offset: 6.0
  front_radius: 8.0
  rear_offset: 0.0
  rear_radius: 8.0
  type: two_circles
force_reinit_new_goal_angular: 0.78
force_reinit_new_goal_dist: 1.0
free_goal_vel: false
gear_change_time: 2.0
global_plan_overwrite_orientation: true
global_plan_prune_distance: 1
global_plan_viapoint_sep: -0.1
h_signature_prescaler: 0.75
h_signature_threshold: 0.1
include_costmap_obstacles: true
include_dynamic_obstacles: true
inflation_dist: 8.0
is_footprint_dynamic: false
legacy_obstacle_association: false
max_global_plan_lookahead_dist: 200.0
max_number_classes: 10
max_number_plans_in_current_class: 10
max_ratio_detours_duration_best_duration: 3.0
max_samples: 500
max_vel_theta: 100.0
max_vel_x: 3.78
max_vel_x_backwards: 3.78
max_vel_y: 0.0
min_obstacle_dist: 4.0
min_turning_radius: 20.0
no_inner_iterations: 5
no_outer_iterations: 4
obstacle_association_cutoff_factor: 5.0
obstacle_association_force_inclusion_factor: 1.5
obstacle_cost_exponent: 4.0
obstacle_heading_threshold: 0.45
obstacle_poses_affected: 15
obstacle_proximity_lower_bound: 0.0
obstacle_proximity_ratio_max_vel: 1.0
obstacle_proximity_upper_bound: 0.5
odom_topic: odom
optimization_activate: true
optimization_verbose: false
oscillation_filter_duration: 4
oscillation_omega_eps: 0.2
oscillation_recovery: false
oscillation_recovery_min_duration: 4
oscillation_v_eps: 1.0
penalty_epsilon: 0.1
publish_feedback: false
roadmap_graph_area_length_scale: 2.0
roadmap_graph_area_width: 60.0
roadmap_graph_no_samples: 45
selection_alternative_time_cost: false
selection_cost_hysteresis: 0.95
selection_dropping_probability: 0.05
selection_obst_cost_scale: 2.0
selection_prefer_initial_plan: 1.0
selection_viapoint_cost_scale: 1.0
shrink_horizon_backup: false
shrink_horizon_min_duration: 10
switching_blocking_period: 2.0
teb_autosize: true
theta_stopped_vel: 0.1
trans_stopped_vel: 0.1
transform_tolerance: 0.5
use_proportional_saturation: false
via_points_ordered: false
viapoints_all_candidates: true
visualize_hc_graph: false
visualize_with_time_as_z_axis_scale: 0.0
weight_acc_lim_theta: 1.0
weight_acc_lim_x: 1.0
weight_acc_lim_y: 1.0
weight_adapt_factor: 2.0
weight_dynamic_obstacle: 50.0
weight_dynamic_obstacle_inflation: 0.1
weight_gear_change: 50.0
weight_inflation: 0.1
weight_kinematics_forward_drive: 1.0
weight_kinematics_goal_orientation: 50.0
weight_kinematics_nh: 1000.0
weight_kinematics_turning_radius: 10.0
weight_max_vel_theta: 1.0
weight_max_vel_x: 1.0
weight_max_vel_y: 2.0
weight_obstacle: 50.0
weight_optimaltime: 10.0
weight_shortest_path: 10.0
weight_velocity_obstacle_ratio: 0.0
weight_viapoint: 1.0
wheelbase: 6.5
xy_goal_tolerance: 0.5
yaw_goal_tolerance: 0.3
2021-10-19 20:43:58 -0500 commented question prevent teb_local_planner from getting stuck while turning around obstacle (carlike)

I have tried multiple values for min_turning_radius from 20 to 30. The actual vehicle I want to model has a pretty big t

2021-10-19 20:43:29 -0500 commented question prevent teb_local_planner from getting stuck while turning around obstacle (carlike)

I have tried multiple values for min_turning_radius from 20 to 30. The actual vehicle I want to model has a pretty big t

2021-10-19 18:36:42 -0500 edited question prevent teb_local_planner from getting stuck while turning around obstacle (carlike)

prevent teb_local_planner from getting stuck while turning around obstacle (carlike) I am running teb_local_planner in s

2021-10-19 01:30:45 -0500 asked a question prevent teb_local_planner from getting stuck while turning around obstacle (carlike)

prevent teb_local_planner from getting stuck while turning around obstacle (carlike) I am running teb_local_planner in s

2021-10-18 07:37:13 -0500 received badge  Notable Question (source)
2021-10-18 05:50:38 -0500 received badge  Nice Answer (source)
2021-10-17 18:41:46 -0500 marked best answer teb_local_planner keeps selecting impossible trajectories for a carlike robot

I am testing teb_local_planner for a carlike vehicle. I am trying to make the robot park backward, for which I would expect the planner to turn in 2-3 times (as a human driver would). However the local planner keeps generating and selecting trajectories that are just impossible for the car to follow (the min_turning_radius is set to 10 meters)

For example here, the selected red path requires the vehicle to make a sharp U-turn, that should not be possible with my min_turning_radius. As the vehicle approaches and fails to follow the local path, the local planner keeps generating more and more complex and impossible paths.

How come the planner can generate such impossible plan?

this trajectory should be impossible

That said, it is not always the case. Sometimes, when I am lucky, the planner manages to generate a very nice 2-way turn curve (like in the picture below).

this is better

What parameters could I adjust to make the planner consistently generate (and select) paths like this instead?

Thanks