kobuki-base / kobuki_ros

ROS2 runtime libraries, nodes and launchers for the Kobuki
46 stars 27 forks source link

Kobuki simulation ros2 humble #47

Open Juancams opened 1 year ago

Juancams commented 1 year ago

Good,

I have modified the urdfs and created a launcher so that you can spawn the kobuki in ros2 humble.

please someone take a look.

Ty.

sabrinaacardoso commented 4 months ago

Hello, I think you can help me.

I'm using the kobuki_node along with the kobuki_description in ROS Humble to visualize the robot's movement in Rviz. My robot is a Turtlebot2i, so I created a specific package with the URDF of the robot's structure and used the URDF of the Kobuki itself for the base.

When I open Rviz, I can only see the robot moving if the frame is set to odom, but I want it fixed on base_link. In the TF tree, the order is odom -> base_footprint -> base_link, and even so, it only moves in odom. Do you have any idea how I can solve this?

Juancams commented 4 months ago

Hello good,

Sorry for answering so late. I know about that error, but I haven't been able to find the solution. Apparently, in the transform tree everything is linked, just like in the urdf you have base_footprint linked to base_link, but for some reason it is not.

The patch to make it work is to directly publish the transform. I do it in the following way in my simulation launcher:

tf_footprint2base_cmd = Node(
        package='tf2_ros',
        executable='static_transform_publisher',
        output='screen',
        arguments=[
            '0.0', '0.0', '0.001',
            '0.0', '0.0', '0.0',
            '1.0', 'base_link', 'base_footprint'
        ],
    )

I hope this works for you too.