Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing question.(About Global plan) #43

Open
CAI23sbP opened this issue Mar 14, 2023 · 6 comments
Open

installing question.(About Global plan) #43

CAI23sbP opened this issue Mar 14, 2023 · 6 comments

Comments

@CAI23sbP
Copy link

Hi @ReykCS long time no see!.
I have one question about installing.
When i had check about global planner , but it was not exist. It's mean that global_planner's topic did not callback.
So i guess that i must install global planner pkg like A*,D* or something else.
Can you explan exactly??
image

@ReykCS
Copy link
Contributor

ReykCS commented Mar 16, 2023

Hey @CAI23sbP ,
unfortunatelly i dont understand your question completely. In general our installation should contain all of the packages you need to run both, training and evaluation. What startup command did you use to start the training for this case?

@CAI23sbP
Copy link
Author

CAI23sbP commented Mar 17, 2023

Oh, i am so sorry @ReykCS. Actually , When i saw your code, there need service which is connected with move_base in plan_collector.cpp .
I had modified global_plan_service_name from global_kino_make_plan to move_base/NavfnROS/make_plan in plan_collector.cpp , and added move_base in single_env_training.launch. And then i launched start_training.launch and train_agent.py. After i run above codes, i met rostopic /sim1/goal and /sim1/global_plan both were not publishing topics.

These issue is very serious to me, from your old paper it spoke to me it was very necessary that to take global plan for connecting a local plan which was made by Reinforcement learning.

Could you solve this issue?
Here is rqt_graph about nodes and topics. i hope it is very helpful to solve or understand this issue.

P.S. In plan_manager.cpp, i think that it did not made a global_plan. you should see this code in plan_manager.cpp
Maybe subscribe topics name has a problem?

image

And can i ask a additional question?
I saw in your old paper, it had a GRU deep learning model. So i checked your code whether it was exist or not, fortunately it was exist. But i can't run this model architecture, because of your checking codes for using stable_baseline3.
Definitely my question is that "How to use GRU model in your code?"

@CAI23sbP CAI23sbP reopened this Mar 24, 2023
@CAI23sbP
Copy link
Author

I solved this issue.
plan_manager.cpp was not subscribe right topic's name.
So you must modify that line.

@ReykCS
Copy link
Contributor

ReykCS commented Mar 24, 2023

Hey @CAI23sbP ,
could you please tell me what line exactly you mean so i can fix the error? Thank you!

@CAI23sbP
Copy link
Author

CAI23sbP commented Mar 24, 2023

@ReykCS
we should modify like under code. (in plan_manager.cpp)
From

  goal_sub_ = nh.subscribe("goal", 1, &PlanManager::goalCallback, this);
  odom_sub_ = nh.subscribe("odometry/ground_truth", 1, &PlanManager::odometryCallback, this,ros::TransportHints().tcpNoDelay()); // odom  //odometry/ground_truth

To

  goal_sub_ = nh.subscribe("move_base/goal", 1, &PlanManager::goalCallback, this); // move_base/goal //move_base/current_goal // move_base_simple/goal 
  odom_sub_ = nh.subscribe("odom", 1, &PlanManager::odometryCallback, this,ros::TransportHints().tcpNoDelay()); // odom  //odometry/ground_truth

And add launch file in single_env_training.launch

<?xml version="1.0" encoding="UTF-8"?>
<launch>
  <arg name="ns" />
  <arg name="map_folder_name" default="map_empty" />
  <arg name="map_path" default="$(find arena-simulation-setup)/maps/$(arg map_folder_name)/map.yaml" />
  
  <!-- use fake localization-->
  <group ns="$(arg ns)">
    <include file="$(find arena_bringup)/launch/utils/fake_localization.launch">
      <arg name="ns" value="$(arg ns)" />
      <arg name="odom_frame_id" value="$(arg ns)/odom" />

      <arg name="global_frame_id" value="map" />
    </include>

    <include file="$(find arena_bringup)/launch/utils/plan_manager.launch">
      <arg name="ns" value="$(arg ns)" />
      <arg name="odom_frame_id" value="$(arg ns)/odom" />
      <arg name="base_frame_id" value="$(arg ns)/footprint" />

      <arg name="train_mode" value="true" />
      <arg name="global_frame_id" value="map" />

      <arg name="look_ahead_distance" default="2.3" /> <!--meter, double -->
      <arg name="tolerance_approach" default="0.6" /> <!--meter, double -->
      <arg name="timeout_goal" default="330." /> <!--sec, double -->
      <arg name="timeout_subgoal" default="20" /> <!--sec, double -->
    </include>
    
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_path)">
      <!-- In multi-env training /clock not available, since we only want one map_server, it's clock topic is remapped to /clock -->
      <remap from="/clock" to="/clock_simulation" />
    </node>

    <!-- spacial_horizon
    <node pkg="spacial_horizon" type="spacial_horizon_node" name="spacial_horizon_node">
      <remap from="$(arg ns)/move_base/current_goal" to="$(arg ns)/move_base/goal" />
      <remap from="/move_base/NavfnROS/make_plan" to="$(arg ns)/move_base/NavfnROS/make_plan" />

    </node> -->

    <!-- use simulator and rviz-->
    <include file="$(find arena_bringup)/launch/training/flatland_simulator.launch">
      <arg name="ns" value="$(arg ns)" />
    </include>
    <!--param name="tf_prefix" value="$(arg ns)"/-->
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

      <rosparam file="$(find arena-simulation-setup)/robot/burger/costmaps/local_costmap_params.yaml" command="load" />
      <rosparam file="$(find arena-simulation-setup)/robot/burger/costmaps/global_costmap_params.yaml" command="load" />
      <rosparam file="$(find arena-simulation-setup)/move_base/move_base_params.yaml" command="load" />
      <remap from="/clock" to="clock" />
      <remap from="cmd_vel" to="/trash" />
      <param name="global_costmap/robot_base_frame" value="$(arg ns)/base_footprint"/>
      <param name="local_costmap/robot_base_frame" value="$(arg ns)/base_footprint"/>
      <param name="local_costmap/global_frame" value="$(arg ns)/odom"/>
      
    </node>

  </group>

</launch>

in plan_collector.cpp
you should modify like this
std::string global_plan_service_name = "move_base/NavfnROS/make_plan"

Last modify is in global_costmap_params.yaml

global_costmap:
  global_frame: map
  robot_base_frame: base_footprint

  update_frequency: 5.0
  publish_frequency: 5.0
  transform_tolerance: 0.25

  static_map: true

  obstacle_range: 3.0
  raytrace_range: 3.5

  footprint:
    [[-0.105, -0.105], [-0.105, 0.105], [0.105, 0.105], [0.105, -0.105]]
  robot_radius: 0.113

  inflation_radius: 0.4
  cost_scaling_factor: 3.0

  inscribed_radius: 0.113
  circumscribed_radius: 0.113

  map_type: costmap
  
  static:
    map_topic: map
    subscribe_to_updates: true

  plugins:
    - {name: static,                  type: "costmap_2d::StaticLayer"}
    - {name: inflation,               type: "costmap_2d::InflationLayer"}

Then a agent can take a observation about global planner
image

@CAI23sbP CAI23sbP changed the title installing question. installing question.(About Global plan) Mar 27, 2023
@ReykCS ReykCS reopened this Mar 29, 2023
@CAI23sbP
Copy link
Author

Hi @ReykCS!.
Long time no see.
Did it fix?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants