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

cyborg-x1's profile - activity

2022-05-27 02:37:06 -0500 marked best answer Is there a environmental variable for current namespace in launchfiles?

Hi,

I have created an multirobot launch for Gazebo. Now I found out that there is a solvable problem with the namespace in the robot state publisher. I solved it with adding a tf_prefix. But now here is what I am interested in.

Is it possible to get the current namespace into the

 <param name="tf_prefix" value="robotA"/>

instead of writing the namespace name? Is there an environment variable that I could for example write something like this to get the "current namespace" for a parameter?:

 <param name="tf_prefix" value="$(optenv ns)"/> <!--  CAUTION: THIS IS NOT A WORKING SOLUTION  -->

Unfortunately robot state publisher does not care about the namespace like for example the gazebo plugins do, if you do not add an tf_prefix they add it automatically.

I also know that there is the possibility to include this by a separate launchfile and add an argument for that.

<!--ROBOT A-->  
<group ns="robotA" clear_params="true">
    <param name="robot_description" command=
    "$(find xacro)/xacro.py $(find h4r_rapid_robot_xacros)/defs/test_robots/diff_drive_bot.xacro" />

    <node pkg="robot_state_publisher" 
          type="state_publisher" name="robot_state_publisher">
        <param name="tf_prefix" value="robotA"/><!-- Is needed, for adding the namespace to other links -->
        <param name="publish_frequency" type="double" value="30.0"/>
    </node>

    <node name="spawn_test_bot" pkg="gazebo_ros" type="spawn_model" 
          args="-z 0.2 -x 0 -urdf -param robot_description -model robot_description" 
          respawn="false" />
</group>

Code is here

Or can I make this code (robot_state_publisher)

  std::string tf_prefix_key;
  n_tilde.searchParam("tf_prefix", tf_prefix_key);
  n_tilde.param(tf_prefix_key, tf_prefix_, std::string(""));

return the current namespace into tf_prefix_ somehow?

UPDATE: I added a pull request for the robot state publisher to be able to use the current namespace as prefix, as long as there is not another approach: https://github.com/ros/robot_state_pu...

Regards,

Christian

2022-05-27 02:37:06 -0500 received badge  Self-Learner (source)
2021-05-23 07:24:42 -0500 received badge  Nice Answer (source)
2020-12-28 10:19:35 -0500 received badge  Famous Question (source)
2020-12-28 10:19:35 -0500 received badge  Notable Question (source)
2020-12-10 14:10:08 -0500 received badge  Famous Question (source)
2020-08-16 18:01:37 -0500 received badge  Famous Question (source)
2020-01-30 05:59:11 -0500 received badge  Self-Learner (source)
2019-12-02 07:13:37 -0500 received badge  Famous Question (source)
2019-08-16 21:24:11 -0500 received badge  Notable Question (source)
2019-08-16 21:24:11 -0500 received badge  Popular Question (source)
2018-04-04 07:56:07 -0500 received badge  Famous Question (source)
2017-08-16 06:04:54 -0500 received badge  Great Answer (source)
2017-08-14 03:00:35 -0500 received badge  Famous Question (source)
2017-06-20 03:27:47 -0500 received badge  Popular Question (source)
2017-06-20 03:27:47 -0500 received badge  Notable Question (source)
2017-05-31 19:14:13 -0500 answered a question Prismatic joint with PositionJointInterface interferes with Gazebo physics

It seems to be a bug, I proposed a fix for it: https://github.com/ros-simulation/gazebo_ros_pkgs/pull/588

2017-05-31 15:13:45 -0500 commented answer Do I always need meshes in *.dae format to simulate in Gazebo?

origin of the object to the center of the 3d cursor. Moving 3d cursor and origin is done by short keys and the menu call

2017-05-31 15:10:50 -0500 commented answer Do I always need meshes in *.dae format to simulate in Gazebo?

Yeah in blender you need to check where your origins of the parts are. And if they are at a wrong position for you move

2017-05-31 14:59:54 -0500 commented question Prismatic joint with PositionJointInterface interferes with Gazebo physics

First I though I have a inertia problem but when I remove that joints - everything is just fine. I will try your hint to

2017-05-31 14:56:45 -0500 commented question Prismatic joint with PositionJointInterface interferes with Gazebo physics

That sounds like the same problem I have. I am trying to create a model for the Farmbot. A gantry. I thought it already

2017-05-31 14:53:30 -0500 commented question ros_control: Difficulty getting custom hardware interface to run

As far as I remember my example you should have the topic cmd_vel as in the launchfile there is a diff drive controller

2017-05-09 11:04:02 -0500 received badge  Famous Question (source)
2017-05-02 15:06:38 -0500 marked best answer Is there something like a node supervisor "class" available?

I want a process to control my nodes, starting pausing, restarting, checking if it still is operational etc. Like a library you add to the node doing that with services and is able to set a value to disable the node from doing processing(by class::running() / class::paused()).

Is there something standardized like that already out there?

Regards,

Christian


I am going to implement something on my own, thanks everybody for your answer.

2017-05-02 12:26:21 -0500 received badge  Famous Question (source)
2017-04-30 02:59:40 -0500 received badge  Good Answer (source)
2017-04-20 14:00:14 -0500 marked best answer Message Type: Heading and Range

If you have a sensor with a beacon, which gives you the distance and the heading ( maybe Quaternion ) to the beacon, is there already a standard ROS message I could use for that?

Regards,

Christian

2017-04-11 16:38:34 -0500 received badge  Taxonomist
2017-04-04 06:26:17 -0500 answered a question Do I always need meshes in *.dae format to simulate in Gazebo?

Hi,

1. With stl as far as I know, only the coloring feature works, so no textures and the full gazebo material. With dae it works, and in the latest version of Gazebo (not in ROS repo yet) it is said to support obj files as well. How the texturing etc. works there, I do not know, I have not tried it yet.

2. You could convert stl to dae using blender. Do not use the Ubuntu shipped version it is compiled without dae support.

Regards,

Christian

2017-04-04 06:21:40 -0500 commented question Loading Multiple World Files one after the other

Hm, I do not think so, I also experienced some stuff in Gazebo like unloading of robots crashes it and so on... so I would recommend to create your own script to start and close gazebo every time when you change the world, just to reset it. Problem: Gazebo also crashes on startup sometimes :/

2017-03-24 10:45:04 -0500 answered a question Questions to SDF, urdf, xacro, material, textures using Gazebo

What?

just now it started working like the way I thought it to..

Well in the package.xml you need:

<run_depend>gazebo_ros</run_depend>

<export>    
  <gazebo_ros gazebo_media_path="${prefix}"/>                             
</export>

and the folder structure is like this:

  • media
    • materials
      • scripts
      • texture

in the xacro file:

<gazebo reference="link">                           
<material>YourMaterial</material>
</gazebo>

I guess in the process I changed the folder structure multiple times, maybe I first missed the media folder.

2017-03-24 07:09:29 -0500 received badge  Notable Question (source)
2017-03-24 06:50:45 -0500 edited question Questions to SDF, urdf, xacro, material, textures using Gazebo

Hi Guys,

Currently I am a little stuck with my xacro model.

I have a texture file which should be attached to a surface in the xacro. How to add materials to your package, what do I need to export (what could I export) in the package.xml

Where do I really find the stuff documenting this features.

Examples:

            <material>
                <script>
                    <name>a/mat</name>
                    <uri>model://some_model/materials/scripts/mat.material</uri>
                </script>
            </material>

I have seen that for url there can be file and model. Does package also work here? What are those replaced with in the end and which of these exist?

Next: in the material file:

 material a/mat
{
  technique
  {
    pass
    {
      ambient 0.5 0.5 0.5 1.0
      diffuse 1.0 1.0 1.0 1.0
      specular 0.0 0.0 0.0 1.0 0.5

      texture_unit
      {
        texture file.png
        filtering trilinear
      }
    }
  }
}

From where and how does it know where file.png is?

Does it just go standard for "../textures" ?

Folder structure is mostly like

  • package
    • models
      • myModel
        • textures
        • scripts

It works for me in a sdf file, but it seems to work never in my xacro.

Somehow this is related to the package.xml as well where you export model or media path I found as well:

<export>    
  <gazebo_ros gazebo_media_path="${prefix}"/> 
</export>

or:

<export>    
  <gazebo_ros gazebo_model_path="${prefix}/models"/> 
</export>

Are there any others and what exactly do they do?

Which variable does that set? Can I see them in my environment?

How are they supposed to be set up correctly - any standard way?

What if for example I want to do a package with materials for gazebo, which should can be used for any package, how do I set that up?

So that I can use them, as you normally can do with "Gazebo/Grey ", "Gazebo/White"

Example*1 (xacro):

  <gazebo reference="link">
    <material>Gazebo/Grey</material>
  </gazebo>

Can somebody just enlighten me how to do it or where I find the documentation for all these things to make it "just right"?

UPDATE ---

I have now checked out multiple locations and found different places to get information about this thing, also found how to debug it.

http://gazebosim.org/tutorials?tut=ros_roslaunch

there it says:

rospack plugins --attrib="gazebo_media_path" gazebo_ros

And I saw that I actually had a problem. It only takes these if you have a <run _depend> on gazebo_ros.

  <run_depend>gazebo_ros</run_depend>


    <export>    
      <gazebo_ros gazebo_media_path="${prefix}/media"/> 
    </export>

But I still do not get my material like that*1.

Update 2:

Just when looking at my own old xacros I found out, you can instead of *1 also do:

  <gazebo reference="link">
        <material value="Gazebo/Grey" />
  </gazebo>

So another Question raised up: Which is now the "prefered" way of doing that?

Which one is deprecated?


Thanks a lot,

Regards,

Christian

2017-03-23 09:47:19 -0500 received badge  Popular Question (source)
2017-03-23 08:15:55 -0500 commented answer Questions to SDF, urdf, xacro, material, textures using Gazebo

Well, with meshes in git, that would be a bit of overload, don't you think? ;-) Even there is the fact, that I do not always use meshes. Like for example you can make neat configurable robots like my gantry_bot in my xacro repo

2017-03-23 07:24:48 -0500 commented answer Questions to SDF, urdf, xacro, material, textures using Gazebo

But you can not change a texture by argument with xacro then.

2017-03-23 07:23:14 -0500 commented answer Questions to SDF, urdf, xacro, material, textures using Gazebo

hmm, that can be an option as well, I agree