ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

joseecm's profile - activity

2023-06-14 12:59:56 -0500 received badge  Favorite Question (source)
2023-05-27 06:07:22 -0500 commented question How to copy folders with subfolders to package installation path?

Hello @scotie, thanks for your answer. My package is a python package, so It doesn't have a CMakeLists.txt.

2023-04-26 10:16:50 -0500 received badge  Famous Question (source)
2023-04-01 21:22:42 -0500 received badge  Popular Question (source)
2023-04-01 21:22:42 -0500 received badge  Notable Question (source)
2023-04-01 21:22:42 -0500 received badge  Famous Question (source)
2023-03-30 10:35:48 -0500 asked a question How to move a model in Gazebo11 from ROS2

How to move a model in Gazebo11 from ROS2 I'm trying to move an object in Gazebo11 from a node in ROS2 Galactic. It is

2023-03-05 15:09:24 -0500 asked a question Problem listening to static transform.

Problem listening to static transform. Hi all! I'm trying to get the static transform between two frames: frame1 and fra

2023-02-15 23:04:10 -0500 received badge  Notable Question (source)
2023-02-15 16:29:43 -0500 answered a question Is there a function to convert coords between two frames?

On Python you can do the transformation using the function tf2_geometry_msgs.do_transform_point( ). See the following s

2023-02-15 16:29:43 -0500 received badge  Rapid Responder (source)
2023-02-15 10:15:10 -0500 commented answer Is there a function to convert coords between two frames?

Thanks for your answer. I am using ROS2 Galactic and when I try to import tf2 in python I get the following error: Modul

2023-02-14 19:09:13 -0500 received badge  Popular Question (source)
2023-02-14 10:21:34 -0500 asked a question Why substitutions in launch files?

Why substitutions in launch files? Hi! Let’s take for example the following launch file to which we pass the argument “

2023-02-14 08:52:24 -0500 asked a question Is there a function to convert coords between two frames?

Is there a function to convert coords between two frames? Hi! With TF2 we can obtain the transformation that relates tw

2023-02-14 08:35:24 -0500 answered a question What's the correct way to load mesh files in Gazebo and Rviz?

You can reference the path to the mesh file in several ways. This works with RVIZ and GAZEBO: <mesh filename="file:

2023-01-26 06:17:41 -0500 received badge  Good Answer (source)
2022-11-28 03:35:30 -0500 received badge  Famous Question (source)
2022-11-12 21:11:42 -0500 received badge  Notable Question (source)
2022-11-12 21:11:42 -0500 received badge  Famous Question (source)
2022-11-11 03:42:04 -0500 received badge  Nice Answer (source)
2022-09-23 09:04:22 -0500 received badge  Popular Question (source)
2022-09-04 22:54:37 -0500 marked best answer How to copy folders with subfolders to package installation path?

I have a python package and want to copy a folder "models", that have subfolders, to installation path. In setup.py file I have tried to do that including the following lines of code:

    data_files=[
    ('share/ament_index/resource_index/packages',
        ['resource/' + package_name]),
    ('share/' + package_name, ['package.xml']),
    (os.path.join('share', package_name, 'models'), glob('models/**', recursive=True)),]

But when I build the package I get this error: "error: can't copy 'models/': doesn't exist or not a regular file".

Please, could someone tell me how I can do it?

Thank you very much in advance for your help.

2022-09-04 22:54:37 -0500 received badge  Self-Learner (source)
2022-09-04 16:56:21 -0500 received badge  Nice Question (source)
2022-07-30 06:59:43 -0500 asked a question What's the correct way to load mesh files in Gazebo and Rviz?

What's the correct way to load mesh files in Gazebo and Rviz? I want to load a URDF model that uses mesh files into Gaze

2022-07-07 04:10:52 -0500 received badge  Notable Question (source)
2022-07-07 04:10:52 -0500 received badge  Popular Question (source)
2022-07-07 04:10:52 -0500 received badge  Famous Question (source)
2022-06-05 20:13:09 -0500 received badge  Famous Question (source)
2022-05-25 04:48:17 -0500 received badge  Notable Question (source)
2022-05-19 10:42:47 -0500 marked best answer Problem spawning in Gazebo a simple URDF model

Hi there!

I'm using ROS2 Galactic and have a python package that simply spawn a robot. It works with a complex URDF model of a robot that have meshes and sensors, but what's driving me crazy is that it doesn't work with the following simple URDF model:

<?xml version="1.0"?>
<robot name="multipleshapes">
  <link name="base_link">
    <visual>
      <geometry>
        <cylinder length="0.6" radius="0.2"/>
      </geometry>
    </visual>
  </link>

  <link name="right_leg">
    <visual>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
    </visual>
  </link>

  <joint name="base_to_right_leg" type="fixed">
    <parent link="base_link"/>
    <child link="right_leg"/>
  </joint>

</robot>

The URDF files are both in the same place. When I run the launch file to spawn the model it seems to work but the model doesn't appear in Gazebo. I don't get errors.

ros@ubuntu:~/ros2_ws$ ros2 launch mars_robot mars_robot.launch.py
[INFO] [launch]: All log files can be found below /home/ros/.ros/log/2022-05-17-18-57-27-755134-ubuntu-24691
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [24693]
[INFO] [gzclient   -2]: process started with pid [24696]
[INFO] [robot_state_publisher-3]: process started with pid [24699]
[INFO] [spawn_entity.py-4]: process started with pid [24701]
[robot_state_publisher-3] Link right_leg had 0 children
[robot_state_publisher-3] [INFO] [1652806649.104605067] [robot_state_publisher]: got segment base_link
[robot_state_publisher-3] [INFO] [1652806649.106763959] [robot_state_publisher]: got segment right_leg
[spawn_entity.py-4] [INFO] [1652806650.703018213] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1652806650.707231388] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] [INFO] [1652806650.711765040] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1652806650.713877199] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-4] [INFO] [1652806650.717389319] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] [INFO] [1652806653.745771815] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-4] [INFO] [1652806653.975522539] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [mars_robot]
[spawn_entity.py-4] /opt/ros/galactic/lib/python3.8/site-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[spawn_entity.py-4]   warnings.warn(
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 24701]

The code of the launch file is the following:

import os
import xacro

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription 
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.actions import SetEnvironmentVariable
from launch.substitutions import EnvironmentVariable

def generate_launch_description():

    pkg_install_path = get_package_share_directory('mars_robot')

    if 'GAZEBO_MODEL_PATH' in os.environ:
        model_path =  os.environ['GAZEBO_MODEL_PATH'] + ':' + pkg_install_path
    else:
        model_path =  pkg_install_path


    xacro_robot_pkg_path = os.path.join(
        get_package_share_directory('mars_robot'))

    xacro_file = os.path.join(xacro_robot_pkg_path,
                              'urdf',
                              'prueba.urdf')

    doc = xacro.parse(open(xacro_file))
    xacro.process_doc(doc)

    node_robot_state_publisher = Node(
        package='robot_state_publisher',
        executable='robot_state_publisher',
        output='screen',
        parameters=[{'robot_description': doc.toxml()}]
    )

    spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
                        arguments=['-topic', 'robot_description',
                                   '-entity', 'mars_robot'],
                        output='screen')

    gazebo = IncludeLaunchDescription(
                PythonLaunchDescriptionSource([os.path.join(
                    get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]),
             )

    return LaunchDescription([
        gazebo,
        node_robot_state_publisher,
        spawn_entity,
    ])

I've been trying to solve the problem for several days but I can't find the solution. Can ... (more)

2022-05-19 10:42:36 -0500 received badge  Rapid Responder (source)
2022-05-19 10:42:36 -0500 answered a question Problem spawning in Gazebo a simple URDF model

Thanks @Joe28965 for your answer, you are right. If I add the inertial and collision tags the model appears in Gazebo. W

2022-05-18 18:44:35 -0500 received badge  Popular Question (source)
2022-05-17 12:08:31 -0500 asked a question Problem spawning in Gazebo a simple URDF model

Problem spawning in Gazebo a simple URDF model Hi there! I'm using ROS2 Galactic and have a python package that simply

2022-05-09 10:01:51 -0500 received badge  Famous Question (source)
2022-05-05 06:14:03 -0500 received badge  Enlightened (source)
2022-05-01 09:00:14 -0500 received badge  Notable Question (source)
2022-03-31 12:02:49 -0500 received badge  Famous Question (source)
2022-03-31 05:30:38 -0500 received badge  Rapid Responder (source)
2022-03-31 05:30:38 -0500 answered a question Urdf, rviz, gazebo and headless remote

If you are going to build a real robot you don't need Gazebo because it is used for simulation in a virtual environment.

2022-03-31 05:15:51 -0500 received badge  Commentator
2022-03-30 17:16:00 -0500 received badge  Good Answer (source)
2022-03-30 04:51:10 -0500 received badge  Nice Answer (source)
2022-03-30 01:36:55 -0500 received badge  Notable Question (source)
2022-03-30 01:36:35 -0500 answered a question ROS2 requires colcon build for any changes in python script?

You don't need to execute colcon build every time you change your python code if you include the option --symlink-instal