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

icub3: add xml files for running mc and ft ros2 nws #228

Merged
merged 3 commits into from
Dec 23, 2022

Conversation

Nicogene
Copy link
Member

@Nicogene Nicogene commented Dec 7, 2022

This PR adds the xml files for running the controlboard ros2 nws for icub3.

I edited the urdf in order to use icub_ROS2.xml file and I run:

ros2 launch robot_state_publisher.py

Where robot_state_publisher.py is

import os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node

def generate_launch_description():

    use_sim_time = LaunchConfiguration('use_sim_time', default='false')

    #urdf = os.path.abspath("/home/ngenesio/icub-tech-iit/ergocub-gazebo-simulations/models/stickBot/model.urdf")
    urdf = os.path.abspath("/home/ngenesio/robotology/icub-models-generator/build/iCub/robots/iCubGazeboV3/model.urdf")
    with open(urdf, 'r') as infp:
        robot_desc = infp.read()

    return LaunchDescription([
        DeclareLaunchArgument(
            'use_sim_time',
            default_value='false',
            description='Use simulation (Gazebo) clock if true'),
        Node(
            package='robot_state_publisher',
            executable='robot_state_publisher',
            name='robot_state_publisher',
            output='screen',
            parameters=[{'use_sim_time': use_sim_time, 'robot_description': robot_desc}],
            arguments=[urdf])
    ])

Then we can decide how to run the robot_state_publisher in a more elegant way.

immagine

cc @traversaro @maggia80 @randaz81 @elandini84 @pattacini

@Nicogene Nicogene self-assigned this Dec 7, 2022
@Nicogene
Copy link
Member Author

Nicogene commented Dec 7, 2022

I could not visualize the meshes for this issue: #229

@Nicogene Nicogene marked this pull request as draft December 16, 2022 16:02
@Nicogene
Copy link
Member Author

With robotology/simmechanics-to-urdf#53 I was able to correctly export the ft frames and then visualize the measurements in rviz

immagine

cc @maggia80 @pattacini @traversaro @randaz81 @elandini84

@Nicogene Nicogene changed the title icub3: add xml files for running mc ros2 nws icub3: add xml files for running mc and ft ros2 nws Dec 19, 2022
@Nicogene Nicogene marked this pull request as ready for review December 22, 2022 09:14
@Nicogene Nicogene requested a review from traversaro December 22, 2022 09:14
@Nicogene
Copy link
Member Author

The PR is ready to be merged, I removed icub_ROS2.xml from the urdf.

Moreover this PR fixes this failure
https://github.com/robotology/icub-models-generator/actions/runs/3754390994

@traversaro
Copy link
Member

Should we write (even a brief) piece of documentation somewere on how to use this configuration files?

@Nicogene
Copy link
Member Author

Should we write (even a brief) piece of documentation somewere on how to use this configuration files?

Right now it is in a sort of hacky state, I could not keep icub_ROS2.xml in the generation of the urdf otherwise who don't have the ros2 nws won't be able to run the model, if someone want to use it has to manually change this line:

<yarpRobotInterfaceConfigurationFile>model://iCub/conf_icub3/icub.xml</yarpRobotInterfaceConfigurationFile>

Or change it directly in the generated urdf.

Then run robot_state_publisher as you prefer, from command line or launch file like
#228 (comment)

If you want I can write these steps, but they are not very "clean"

@traversaro
Copy link
Member

If you want I can write these steps, but they are not very "clean"

Yes, I agree that they are not clean (idealy, we should not touch files installed by icub-models) but I think that we should document this, otherwise the files can't be used.

Can you open a PR on icub-models to document this? Thanks! Note that I would just keep the description of the modification of the generated file, as tipically users of the models do not interact with icub-model-generator at all. Then we can probably open an issue to track how to handle this in a clean way.

@Nicogene
Copy link
Member Author

PR in icub-models opened: robotology/icub-models#184

We need first merge this PR.

@traversaro
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants