ROSSharp RVIZ Odometry Issue

asked 2018-12-11 09:47:22 -0500

rosfox gravatar image

Hello together,

I am facing following problem: The robot in RVIZ does not move accordingly to the behavior in Unity, I am using ROSSharp with Unity and ROS is running on a Ubuntu VM. ROS Distribution Kinetic is used.

Unity publishes with the JointStatePublisher and the PoseStampedPublisher. My Odometry Frame File looks promising, as all Frames are properly connected ( https://docdro.id/cIGCq2o ).

Question: When not setting a static transform between the base_footprint and the base_link in my launch file, there is no movement at all in RVIZ, although this transform should be handled by the Robot_State_Publisher. When I add a static transform between the base_footprint and the base_link the robot receives movement. BUT: He is more or less jumping around in the map.

My launch file looks like the following

<launch>
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find mir_description)/urdf/mir.urdf.xacro'"/>
<param name="robot_description" command="$(arg urdf_file)" />
  <param name="use_sim_time" value="false" />

<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <param name="port" value="9090"/>
</include>

<node name="file_server" pkg="file_server" type="file_server" output="screen"/>
<node name="rqt_graph" pkg="rqt_graph" type="rqt_graph" output="screen" />
<node respawn="true" pkg="joy" type="joy_node" name="turtle_joy" >
        <param name="dev" type="string" value="/dev/input/js0" />
        <param name="deadzone" value="0.12" />
</node>
<arg name="scan_topic"  default="/scan" />
<arg name="base_frame"  default="base_footprint"/>
<arg name="odom_frame"  default="odom"/>

<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
        <param name="base_frame" value="$(arg base_frame)"/>
        <param name="odom_frame" value="$(arg odom_frame)"/>
        <remap from="scan" to="$(arg scan_topic)"/>
</node>

   <node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="1 0 0 0 0 0 odom base_footprint 
   100" />

    <node pkg="tf" type="static_transform_publisher" name="odom_to_base_link2" args="1 0 0 0 0 0 base_footprint base_link 100" />

<arg name="use_tf_static" default="false"/> 
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" >
    <param name="use_tf_static" value="$(arg use_tf_static)"/>
</node>

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

<node pkg="rviz" type="rviz" name="rviz"/>

      </launch>

Second Question How can I set the appropriate values for the static transformation?

Best Regards

edit retag flag offensive close merge delete