mteb/BrightProRoboticsRetrieval huggingface dataset:
ros2 parameter setting

I would like to follow a simple take off and land example without any launch files or yaml files on ros2 crazyswarm (Physical Experiments part). What could be the reason for the following output, thanks.

ntukenmez3@ae-icps-407120:~/Documents/ros2_ws$ ros2 param set crazyflie_server cf231.params.commander.enHighLevel 1
Setting parameter failed
How to put ArUco markers in Gazebo Classic

The title says it all. I would like to test my robot's ArUco recognition and processing abilities by putting some markers around environments in classic Gazebo.

All the tutorials I see online seem to be for older versions of Gazebo and (frankly) use some very elaborate tricks.

What is the canonical way of adding a marker to Gazebo?

EDIT: My version of Gazebo is 11.10.2, by "older versions of Gazebo" I mean older versions of Gazebo classic specifically. Sorry for any confusion.
Cannot locate rosdep definition, error on micro-ROS

I'm trying to set up micro-ROS on Ubuntu 20.04 using this website, and connect ESP32 to ROS 2. However, when executing the command ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32, I get the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rclc_parameter: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
rmw: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
rmw_implementation: Cannot locate rosdep definition for [rcpputils]
rosidl_typesupport_c: Cannot locate rosdep definition for [mimick_vendor]
rosidl_default_runtime: Cannot locate rosdep definition for [rosidl_typesupport_introspection_cpp]
rcl_logging_noop: Cannot locate rosdep definition for [launch_testing]
rosidl_typesupport_microxrcedds_c_tests: Cannot locate rosdep definition for [rosidl_typesupport_introspection_c]
tracetools_launch: Cannot locate rosdep definition for [launch_ros]
rcutils: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
rcl_action: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
libyaml_vendor: Cannot locate rosdep definition for [rcpputils]
rcl_lifecycle: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
tracetools_test: Cannot locate rosdep definition for [launch_ros]
test_rmw_implementation: Cannot locate rosdep definition for [rmw_dds_common]
rclc_lifecycle: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
rosidl_typesupport_cpp: Cannot locate rosdep definition for [rcpputils]
rcl: Cannot locate rosdep definition for [rcpputils]
ros2trace: Cannot locate rosdep definition for [ros2cli]
rclc: Cannot locate rosdep definition for [osrf_testing_tools_cpp]
Is there any solution?

Incidentally, I implemented the following solution suggested by ChatGPT, but it didn't improve the situation.

Update ROS 2 dependencies. rosdep update
Install System Packages, which ROS2 packages or stacks depend on. rosdep install --from-paths /path/to/your/ros2/workspace --ignore-src --rosdistro <your_ros_distro>
Rebuild the ROS 2 workspace. colcon build
Intel RealSense with ROS 2

I am just getting started with Intel Real Sense integration with ROS2. When trying to install Intel real sense packages in ROS 2 Humble, the official documentation says the supported kernel version of this package is only for 5.4 or less. On the contrary, by default, the kernel version of ROS2 humble in Ubuntu 22 is 6.

Please give some input on whether ROS2 Humble supports real-sense integration.
Use sim time with Moveit

I am having a problem trying to use Moveit2 in simulation, I created the Moveit config package for my robot arm using the setup assistant, but the generated move_group.launcy.py file looks like this:

from moveit_configs_utils import MoveItConfigsBuilder
from moveit_configs_utils.launches import generate_move_group_launch


def generate_launch_description():
    moveit_config = MoveItConfigsBuilder("ur", package_name="flower_catcher_moveit_config").to_moveit_configs()
    return generate_move_group_launch(moveit_config)
The problem with this format is that there is no way for me to set the use_sim_time parameter to true, and that causes the path execution to fail with this error:

[move_group-7] [INFO] [1696192877.744131744] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 1696192876.744054, but latest received state has time 148.003000.
I kind of solved the problem by setting the parameter afterward with the command

ros2 param set /move_group use_sim_time true
However, I want to know if there is a way to set this parameter in the launch file.

Thanks!
Setting frame of IMU message in Gazebo Fortress

I am trying to setup a robot in Gazebo Fortress, under ROS2 Humble in Ubuntu 22.04. This robot has 6 wheels, a lidar and an IMU. I have setup the xacro files and I am able to spawn the robot into Gazebo and get laser and IMU readings.

However, the frame of the IMU messages is not correct. This is my IMU gazebo code in its corresponding xacro file:

    <gazebo reference="${prefix}_${imu_name}">
        <material>Gazebo/Black</material>
        <gravity>true</gravity>
        <sensor name="${prefix}_imu_sensor" type="imu">
            <always_on>true</always_on>
            <update_rate>25</update_rate>
            <visualize>false</visualize>
            <topic>${prefix}/imu</topic>
            <plugin filename="libignition-gazebo-imu-system.so" name="ignition::gazebo::systems::Imu">
            </plugin>
            <pose>0 0 0 0 0 0</pose>
        </sensor>
    </gazebo>
I have tried to add frameID to the plugin parameters, as I did in Gazebo Classic, but it didn't work. My questions are:

How to change the frame published in the messages?
What parameters are available for the IMU plugin? Is there any documentation or where can I read the source code?
Thank you!
ROS Environment variables not set after new Humble install on Ubuntu 22.04

I carefully followed the install instructions for installing ROS2 Humble binary.

https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html

The install had no errors. And I did the talker-listener test to make sure.

But none of the ROS environment variables are set.

When I type printenv I don't see ROS_VERSION=2,ROS_PYTHON_VERSION=3 or ROS_DISTRO=humble.

The tutorials page just says to go back to the installation page or get help from the community. So here I am :)

Thanks in advance!
ROS2 Map not received when using nav2_bringup

I'm currently using the TurtleBot2 on Ubuntu 22.04 Humble and successfully generated a map with ros2 launch nav2_bringup navigation_launch.py. I was able to use the command ros2 launch nav2_bringup bringup_launch.py map:=/name/of/path.yaml several times (it was showing the map sometimes and wasnt showing the map sometimes aswell) but now whenever I am launching the command it tells me

[component_container_isolated-1] [INFO] [1695317742.382350265] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist

Opening the rviz config /nav2_bringup/rviz2/nav2_default_view.rviz results in Rviz2 telling me, that no map is received. I was trying to change the QoS aswell, which didnt have an impact at all.

I have looked into rqt_graph and /map was connected to global_cost_map, also I checked rqt and /map was not receiving any messages when I have monitored it in rqt.

Can someone help me out please?
In ROS, is it possible to do dynamic reconfigure with "nested" parameters?

Not positive I have the terminology right, but the idea is that I have a ROS 1 node that can have multiple "layers" of namespaces for some of the parameters. So the parameter list is something like:

/perception_node/map_size
/perception_node/sensor_1/max_range
/perception_node/sensor_2/max_range
It doesn't have to be set up this way, the key here is that there are multiple "sensor" objects that have the same parameter names, but can have different values. And the sensor names themselves should ideally be configurable from the launch file or a YAML file.

I'm able to get it up and running so that it all initializes correctly, I can have a sensor struct like this:

struct Sensor
{
    string sensor_name;  // < This gets set in the constructor
    float max_range;

    void configure(ros::NodeHandle & nodeHandle)
    {
        max_range = nodeHandle.param(sensor_name + "/max_range");
    }
};
And that works, but I'd really like to use dynamic reconfigure with this setup too. I've used dynamic reconfigure before on other projects, so I know the basics of creating a ".cfg" file and everything.

But dynamic reconfigure doesn't seem to like parameter names with "/" symbols in them, at least when I tried the following it failed to compile:

gen = ParameterGenerator()

gen.add("sensor_1/max_range", float_t ...etc....
My initial idea was that since the ".cfg" file is (I think) really a python file, I could do something clever here and read the sensor names from a configuration file rather than hard coding it like in the above example.

I also tried using groups, but it looks like you're not allowed to use the same parameter name more than once even if you do this:

sensor_1_params = gen.addGroup("sensor_1")
sensor_1_params.add("max_range", float_t ...etc...

sensor_2_params = gen.addGroup("sensor_2")
sensor_2_params.add("max_range", float_t ...etc... #Nope! This fails to compile too
The only thing I can think of right now is to get rid of the slashes, so that the parameters are called something like "sensor_1_max_range" and "sensor_2_max_range" and so on. The issue being that it would make the config callback kind of ugly, because on the C++ side I'd have to do something like:

if (sensor_name == "sensor_1") {
    max_range = config.sensor_1_max_range;
}
else if (sensor_name == "sensor_2") {
    max_range = config.sensor_2_max_range;
}
// And many more lines...
I also feel like this kind of defeats the purpose of having the sensor names in a configuration file, because now any time we want to add or remove sensors we need to edit the configuration file AND the C++ code.

So, I guess I'm wondering is it possible to actually do something like what I want? Have people had to deal with this before? Or am I better off restructuring things?
Configuration wrt. automatic chaining of `setup.bash` prefix paths from `colcon build`

I recently found (to my great surprise) that upon issuing 'source install/setup.bash' for my ROS 2 install (built from source), that both Gazebo Sim and ros_gz_bridge were also sourced automatically.

So I had a look at the ROS 2 install/setup.bash script, and indeed it mentions:

# This script extends the environment with the environment of other prefix
# paths which were sourced when this file was generated as well as all packages
# contained in this prefix path.
So probably I did the following:

Compile and source ROS 2,
Compile and source Gazebo Sim,
Compile and source ros_gz_bridge,
Compile ROS 2 again.
I wonder if many people are aware of that behavior. In any case I did not know of this automatic chaining, nor was expecting it, as:

In above case, it is obviously undesirable that the ROS 2 setup.bash script would chain the Gazebo and ros_gz_bridge scripts,

But even in other cases this can be undesired. E.g. the ros_gz_bridge obviously depends on ROS 2 and Gazebo Sim, but even then I might want to source a different ROS 2 install (e.g. with some local changes, irrelevant to ros_gz_bridge). So I don't necessarily want the ros_gz_bridge to automatically source the ROS 2 install that was sourced at build time.

Is there some documentation wrt. this behavior?
How to deserialize ROS messages from Bag to ROS defined types in C++?

I want to deserialize messages from a Bag file and publishing part of their contents with ROS for further processing.

I read a bagfile with the ROS C++ API. I know exactly the content (topic names and types) of my messages at compile time, such that I want to deserialize it into common ROS defined classes (e.g. the ones defined here https://docs.ros.org/en/noetic/api/sensor_msgs/html/index-msg.html) at runtime. Here some code:

#include <rosbag/bag.h>
#include <rosbag/view.h>
//other content
  rosbag::Bag bag;
  bag.open("foo.bag", rosbag::bagmode::Read);

  std::vector<std::string> topics{"camera1/camera_info"};

  rosbag::View view(bag, rosbag::TopicQuery(topics));

  for(auto const m : view)
  {
      const std::string& topic_name = m.getTopic();
      std::cout << topic_name << std::endl;
      std_msgs::String::ConstPtr s = m.instantiate<std_msgs::String>();
      if (s != NULL)
          std::cout << s->data << std::endl;
 
      // I want the data in s as a string to be serialized into an instance
      // of the type CameraInfo located in 
      // path/ros/distro/sensor_msgs/CameraInfo.h shipping with ROS.
      CameraInfo ci = is_there_any_os_solution(s); //?
  }

  bag.close();
I tried to find something on this direction but I just found libraries deserializing contents unknown at compile time.

Could anyone give some hints?
Set interface name without msg in ROS2

When creating custom message types in ROS1 (noetic), I can store the *.msg files in a subfolder named msg. In the CMake file, I just type the name of the file without msg/ in add_message_files(...). The resulting message type is named as <pkg_name>/<file-name (without .msg)>

When creating interfaces in ROS2 (foxy), I have to type the file name in my CMake file including the relative path in rosidl_generate_interfaces(...) like msg/<filename.msg>. The resulting interface name also includes msg: <pkg_name>/msg/<file-name (without .msg)>, but actually I don't want the exact path as an interface name.

So my question is: Is it possible to store the files in the msg folder for a better folder structure but set the name of the resulting interface differently?
Controlling Arduino device from ROS node

How can a motor control node (which will subscribe to the cmd_vel topic) be linked to my robot hardware?

My first idea is to communicate via byte signal like

|0000|0000|0000|0000|0000|

as

|ID|Motor_1|Motor_2|Motor_3|Motor_4|

Arduino will be used as the low level hardware control, and receive the signal and information via byte using a nrf240L1 module. Would this work?
How to add a header with timestamp to numpy_msg?

I am using the rospy with numpy tutorial to create a publisher and subscriber that send numpy arrays to listener that uses an ApproximateTimeSynchronizer. However, I receive an error when I try to instantiate the listener:

[WARN] [1693265081.824595]: Cannot use message filters with non-stamped messages. Use the 'allow_headerless' constructor option to auto-assign ROS time to headerless messages.
So my understanding is that my message must contain a header with a time stamp. Is it possible to add a header with a timestamp to a numpy_msg? And if so, how do I this?

My message publisher construction:

from rospy_tutorials.msg import Floats
from rospy.numpy_msg import numpy_msg

l_lines_pub = rospy.Publisher('/l_lines_output', numpy_msg(Floats), queue_size=10)
r_lines_pub = rospy.Publisher('/r_lines_output', numpy_msg(Floats), queue_size=10)

l_lines_msg = np.asarray(ARRAY1)
r_lines_msg = np.asarray(ARRAY2)

l_lines_pub.publish(l_lines_msg)
r_lines_pub.publish(r_lines_msg)
And my subscriber looks like:

l_lines_sub = Subscriber('/l_lines_output', numpy_msg(Floats))
r_lines_sub = Subscriber('/r_lines_output', numpy_msg(Floats))

ats = ApproximateTimeSynchronizer([l_lines_sub, r_lines_sub], queue_size=5, slop=0.015)
ats.registerCallback(gotData)
Thanks!
Rosdep installing python dependencies as root seems to break the installation

I started with ROS2 for robotic development. As far as I understand one must specify the dependencies of the code in package.xml (for example all python imports) and rosdep will install these dependencies for you using sudo. Pip warns against this type of install saying that the installation may break.

I use modules from Adafruit-Blinka (board). Blinka is specified in the <exec-depend> tag and it is recognized (it is in python.yaml). Rosdep install Adafruit-Blinka as root. Next I run the code and as soon as board is imported the code crashes with the following error: Module not found: 'hid' (full error message at the end).

I can reproduce this problem with a simple python program containing one line: import board. It crashes in the same way as the ros program (Module not found: 'hid'). When I first sudo pip uninstall Adafruit-Blinka and next pip install Adafruit_Blinka (without sudo), I can import board without problems.

Is it correct to assume that a sudo pip install causes module 'hid' not to be found? If so, is there a workaround so that rosdep does not install the modules as root?

Full error message:

$ ros2 run sensor_vl53l1x talker
Traceback (most recent call last):
  File "/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/sensor_vl53l1x/talker", line 33, in <module>
    sys.exit(load_entry_point('sensor-vl53l1x==0.0.0', 'console_scripts', 'talker')())
  File "/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/sensor_vl53l1x/talker", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/python3.10/site-packages/sensor_vl53l1x/vl53l1x_publisher.py", line 5, in <module>
    import board
  File "/usr/local/lib/python3.10/dist-packages/board.py", line 22, in <module>
    from adafruit_blinka.agnostic import board_id, detector
  File "/usr/local/lib/python3.10/dist-packages/adafruit_blinka/agnostic/__init__.py", line 21, in <module>
    chip_id = detector.chip.id
  File "/usr/local/lib/python3.10/dist-packages/adafruit_platformdetect/chip.py", line 90, in id
    import hid
ModuleNotFoundError: No module named 'hid'
[ros2run]: Process exited with failure 1
E: Unable to locate package ros-galactic-ros-gz

I am trying to install (ignition) Gazebo Edifice on my Ubuntu 20.04 system which already has ROS2 Galactic installed on it.

I'm using the command sudo apt-get install ros-galactic-ros-gz as mentioned here. But apt says it's not able to find the binaries as shown below. enter image description here

How should I go about this?
Gazebo ignition (garden/fortress) attaching model to arm

I'm trying to attach a moving object with inertia to a robotic arm. I saw that there are plugins for detaching joints but is there a way to do the opposite and attach one model to another via a joint? preferably it would maintain its velocity and angular velocity till acted on by the arm. If not, then could 2 separate SDF models be designed one with the model attached, then swap one model for the other during simulation?
How to build a python node as a component?

I have a python node that I would like to add to a composable node container.

I could not find any documentation on the python equivalent to the rclcpp_components_register_node cmake command. I would assume that I would need to adjust the python code of the node as well as the setup.py file.

Naively, I have just tried to add the executable in the ComposableNode():

ComposableNode(
    package="foo",
    plugin="foo_node",
    name="foo",
),
but got the following error when launching:

[ERROR] [bar.container]: Could not find requested resource in ament index
[ERROR] [launch_ros.actions.load_composable_nodes]: Failed to load node 'foo_node' of type 'foo_node' in container '/bar/container': Could not find requested resource in ament index
It would be great if you could help me figure this out. Thanks.
Path and trajectory planning for a holonomic drivetrain with non zero starting velocities

What path planning algorithms are typically used for holonomic drivetrains that can avoid collisions while also starting with non zero velocities. I am working on a project where I am planning to have a robot avoid common household objects, drive around them, but do so in a way that it can be on the fly may result in the robot having a non zero starting velocity. I have looked into A* and that could work when using cubic or quintic splines as that could account for the current velocity, but when accounting for more sophisticated object avoidance using something like rrt, I am unsure as to how that would work with a non zero starting velocity. Thank you!
How is TF2 supposed to be set up for an Ackerman steering robot with Navigation2

Hello, I am currently working with a physical, ackermann steering robot (car like). Right now my TF is setup with base_link on the ground between the two rear wheels. However, I notice strange behavior with navigation2, including trying to steer but not move. I then wondered whether my tf is setup correctly, maybe I need to give navigation 2 a link at the center of my robot, or between the two front wheels ? I didn't find anything online so I think it would be great to have something detailed on it. In navigation2 I use a MPPI controller with Reeds_Shepp motion model, the path seems to be correctly generated and every link in the parameters is setup to base_link. Also, base_link is setup as X forward,Y on the left and Z up, and I work on Humble. I hope someone will be able to help me, tell me if you need more info and I'll try to give them as fast as possible !
How to add to the library search path for custom plugins

Gazebo Answers logo

Hi,

I'm running a gz-sim (Garden) simulation starting from PX4 where I want to include a custom plugin into my model. The model works if I copy-paste the .so file to any of the default search locations, i.e.

- /home/anton/.gz/sim/plugins/
- /usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/
- /home/anton/.ignition/gazebo/plugins/
However, I'd prefer to set an environment variable (as in Gazebo-Classic) to tell gazebo to search for additional plugins. In gazebo-classic I could do

export GAZEBO_PLUGIN_PATH="$PWD:$GAZEBO_PLUGIN_PATH"
but this doesn't seem to work in gz-sim garden.

Is there any other way to add to the library search path of gz-sim?
Add files to be loaded when ROS node is launched

Rosanswers logo

Hello ROS community,

I have a python code for a hardware device (radar) that uses a parameters.cfg file for hardware settings (independantly of ROS).

In the same code, I am creating a ROS node so that the device publishes its collected data.

When I use a launch file, the basic format is as follows :

<launch>
 <node pkg="radar_uart" 
    name="radar" 
    type="radar.py" 
    output="screen"> 
 </node>
</launch>
But when I do my $roslaunch radar radar.launch command, I get the error that it could not find the config file : [ No such file or directory 'radar_config30hz.cfg' ]

I tested by adding this line to the launch file, so the config would be loaded when launching the node :

<rosparam file="$(find radar)/src/radar_config30hz.cfg" command="load"/>
It is still not working and the new error is : [ Ressource not found: your_package_name ]

PS : As said the file is a not a dynamic reconfigure file, it just contains parameters to be used by the radar Hardware.

Please enlighten me on how to simly make the ros node find the file and use it when it launches.

Thanks and regards,

Lilia