Hi, I'm using ROS melodic on Ubuntu 18 and I want to perform SLAM using rviz.
I have got a dual drive robot controlled by Arduino via Serial. I have a node that reads/writes data from serial and publish/subscribe them as topic.
This is the topic list:
/clicked_point
/cmd_vel
/cmd_vel_mux/input/navi
/diagnostics
/horizontal_servo_pos
/initialpose
/joint_states
/joy
/joy/set_feedback
/left_encoder
/left_motor_speed
/left_velocity
/left_wheel_target
/make_scan
/map
/map_metadata
/map_updates
/move_base/current_goal
/move_base/goal
/move_base_simple/goal
/odom
/right_encoder
/right_motor_speed
/right_velocity
/right_wheel_target
/rosout
/rosout_agg
/scan
/serial_msg
/slam_gmapping/entropy
/tf
/tf_static
/ultrasonic_distance
/ultrasonic_scan
/vertical_servo_pos
This is my file .urdf
<robot name="robot">
<link name="odom">
</link>
<joint name="base_to_odom" type="fixed">
<parent link="odom"/>
<child link="base_footprint"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
</joint>
<link name="base_footprint">
<visual>
<geometry>
<box size="0.23 0.12 0.01"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.055"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
</robot>
This is my launch file for navigation:
<launch>
<arg name="model" default="$(find robot)/urdf/robot_z.urdf"/>
<arg name="gui" default="true" />
<arg name="rvizconfig" default="$(find robot)/rviz/config_z.rviz" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
<param name="use_gui" value="$(arg gui)"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
<include file="$(find robot)/launch/includes/gmapping.launch.xml"/>
<include file="$(find robot)/launch/includes/move_base.launch.xml"/>
</launch>
I can use a Joystick to move around the robot.
This is my rviz screenshot: https://pasteboard.co/IumPN58.png
I can move the robot (rappresented by "little car" ) in this world but the laser scanner refers to /odom
in the center of world.
I tried to change "Fixed frame" from map to "base_footprint" and the robot figure holds in the map while the other axes move around the world with laser scanner points as shown in figure:
https://pasteboard.co/IumQ8iJ.png
How can I link the robot with laser scanner and odometry?
However I get this warning:
[ WARN] [1566756673.514885761]: Timed out waiting for transform from \base_footprint to \map to become available before running costmap, tf error: canTransform: target_frame \map does not exist. canTransform: source_frame \base_footprint does not exist.. canTransform returned after 0.100995 timeout was 0.1.
I also like to use 2DNavGoal function to comand the robot from rviz but when i use it, nothing in appening.
Thanks a lot. If you need other info I will update the post.
Originally posted by FabioZ96 on ROS Answers with karma: 48 on 2019-08-25
Post score: 0