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

node to randomly generate start and goal positions

asked 2021-04-14 17:22:49 -0600

Eman.m gravatar image

updated 2021-04-14 18:31:47 -0600

Hello

I need to create an experiment in ROS. Using C++, I need to randomly generate 50 start and goal positions( validating they are not out of the world or map and not obstacles). For each start and goal scenario, I want to measure the path length and run time then save them in Excel file for example.

I did this experiment in c++ simulator, but in ROS, I do not know where should I start from, Using ROS, I can move rosbot2 in willow garage world by publishing start and goal in Terminal.

Do I need to implement a node? as https://wiki.ros.org/navigation/Tutor...

what about a node to send start? can I implement a node to do both(sending start and goal)?

Do you have any recommendations or useful tutorials to start from?

Can I include such a node in my navigation launch file?

This is my navigation launch file:

<launch>
    <arg name="use_rosbot" default="false"/>
    <arg name="use_gazebo" default="true"/>
    <param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>
    <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
    <arg name="map_file" default="$(find rosbot_navigation)/maps/willowgarage-refined.yaml"/>
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
    <node unless="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="map_odom_tf" args="0 0 0 0 0 0 map odom 100" /> 

    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="base_global_planner" value="navfn/NavfnROS"/>
        <param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/>
        <param name="controller_frequency" value="10.0"/>
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
    </node>
</launch>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-17 02:40:35 -0600

miura gravatar image

Do I need to implement a node?

It's not necessarily necessary. You can use rostopic pub instead. However, if you want to use existing C++ code, or if you want to have detailed control, it would be more convenient to create it.

what about a node to send start? can I implement a node to do both(sending start and goal)?

publish initialposefor the starting position. ref: http://wiki.ros.org/amcl?distro=noeti...

For the goal, you should publish move_base/simple_goal. ref: http://wiki.ros.org/move_base#Subscri...

Do you have any recommendations or useful tutorials to start from?

I don't know of any useful tutorials.

Can I include such a node in my navigation launch file?

Yes, you can include it in the your navigation launch file.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-04-14 17:22:49 -0600

Seen: 253 times

Last updated: Apr 17 '21