Robot is not moving to goal
I have a simulation in gazebo with two robots. I launch navigation file so i can send goals to a robot. I use this command to move robot to a goal
rostopic pub /r2/move_base_simple/goal geometry_msgs/PoseStamped '{header: {stamp: now, frame_id: "map"}, pose: {position: {x: 3.0, y: 2.0, z: 0.0}, orientation: {w: 1.0}}}'
robot looks lost in space and is randomly moving.
graph:
frames: https://files.fm/u/7gzgncpa
I want robot to move to its goal when i send the command.
Here's the launch file to launch two robots in gazebo simulation
<launch>
<param name="/use_sim_time" value="true"/>
<!-- Run GAZEBO World -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find multi_pioneer)/worlds/clearpath_playpen.world"/> <!-- world_name is wrt GAZEBO_RESOURCE_PATH environment variable -->
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
<!-- Robot1 with diff drive -->
<include file="$(find multi_pioneer)/launch/pioneer3dx.gazebo.launch">
<arg name="robot_name" value="r1" />
<arg name="robot_position" value="-x 0.0 -y -0.5 -z 0.0 -R 0 -P 0 -Y +1.57" />
</include>
<!-- Robot2 with diff drive -->
<include file="$(find multi_pioneer)/launch/pioneer3dx.gazebo.launch">
<arg name="robot_name" value="r2" />
<arg name="robot_position" value="-x 0.0 -y 0.5 -z 0.0 -R 0 -P 0 -Y -1.57" />
</include>
</launch>
Launch file to spawn a single robot
<launch>
<arg name="robot_name" default="p3dx" />
<arg name="robot_position" default="-x 0.0 -y 0.0 -z 0.01" />
<group ns="$(arg robot_name)">
<!-- Load the URDF into the ROS Parameter Server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find multi_pioneer)/xacro/p3dx/pioneer3dx.xacro'" />
<!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -model $(arg robot_name) -param robot_description $(arg robot_position) "/>
<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
<param name="publish_frequency" type="double" value="30.0"/>
<param name="tf_prefix" type="string" value="$(arg robot_name)"/>
</node>
</group>
</launch>
File to launch navigation
<launch>
<node name="map_server" pkg="map_server" type="map_server" args="$(find multi_pioneer)/maps/playpen_map.yaml" output="screen">
<param name="frame_id" value="/map" />
</node>
<!-- Robot 1 Localization & Navigation -->
<include file="$(find multi_pioneer)/launch/navigation.launch">
<arg name="tf_prefix" value="r1"/>
<arg name="initial_pose_x" value="0.0"/>
<arg name="initial_pose_y" value="-0.5"/>
<arg name="initial_pose_a" value="1.57"/>
</include>
<!-- Robot 2 Localization & Navigation -->
<include file="$(find multi_pioneer)/launch/navigation.launch">
<arg name="tf_prefix" value="r2"/>
<arg name="initial_pose_x" value="0.0"/>
<arg name="initial_pose_y" value="-0.5"/>
<arg name="initial_pose_a" value="-1.57"/>
</include>
<node pkg="tf" type="static_transform_publisher" name="odom_to_odom_r1" args="0.0 0.0 0.0 0.0 0.0 0.0 odom r1/odom 100" />
<node pkg="tf" type="static_transform_publisher" name="odom_to_odom_r2" args="0.0 0.0 0.0 0.0 0.0 0.0 odom r2/odom 100" />
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args ...
move_base
publishes action related topics (e.g., /move_base/status). Can you verify that when you send your goal themove_base
action server is registering it?Can you verify that your Husky is subscribed to the correct /cmd_vel topic? And check if anything is being published on it
What are your planner parameter? Somewhere one should get current position of the robot in the move_base...
What if you try to publish odom on "husky2/odom"? since you are using "husky2" as group namespace. Are you shure that parameter "tf_prefix" should not be defined under node "move_base"?
husky2/odom gives an error. tf_prefix definitely has to be before move_base node
there is missing information how do you start your husky1 robot. Can you post your frames and node graph?
graph: https://i.imgur.com/vgHnfXr.png frames: https://files.fm/u/xtby736c
@topkek Can you please add those files directly into the question. That way the question will be self-contained and if/when those external links disappear your question will not lose any information.
Can you update launch files, node graph (in "Node/Topic (all)" option) and error message in the question? Do that we can follow easier.