mteb/BrightProRoboticsRetrieval huggingface dataset:
Can’t see debug messages using RCLCPP_DEBUG

I can’t see messages using RCLCPP_DEBUG by terminal and rqt, but I can using other levels of verbosity( INFO, ERROR, FATAL…).Selecting debug in rqt to see those messages doesn’t work either.

I’m using rolling, working in C++ in a plugin of a controller and launching tb3_simulation_launch.py from nav2_bringup.

I also saw a post here where they recommended to set the environment variable:

RCLCPP_LOG_MIN_SEVERITY=RCLCPP_LOG_MIN_SEVERITY_DEBUG

but that didn’t work either. It must be something silly that I’m missing. Has this ever happened to you?

Thank you
sensor fusion of lidar and camera detection

I am trying to achieve sensor fusion between two sensors(camera and lidar). I have two separate node(one is publishing detection results using camera, and other is using lidar and they both are operating on a seperate deep learning based object detection methods) which are publishing detection results in the form of vision_msgs detection array.

Now I want to fuse these detection results. How can I go further? I am using ros2 humble with gazebo fortress and I am trying this experiments in the simulated environment only. (no real sensors)
Running ros1 packages with ros2 data

I'm trying to run different lidar based SLAM methods in order to produce a map of an environment. I've recorded my data in both .db3 and .mcap formats, but a lot of SLAM methods (an example being Interactive SLAM by SMRT-AIST) are only implemented on ROS1 with the .bag format. Is there any way to either change the modern formats to .bag or is there another way to use these older packages with ROS2 datatypes?
ldlidar ros 2, colcon build error, pthread mutex init/lock/unlock not declared

So i am trying to use the LD19 Lidar from ldrobot with ros2_iron. I am following this tutorial: https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2. When i enter colcon build in the console it runs to 87% and then fails. I am using Rasbian OS on Raspberry Pi 5. The console shows this:

Starting >>> ldlidar_stl_ros2
--- stderr: ldlidar_stl_ros2                              
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp: In member function 'void LogModule::InitLock()':
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp:172:3: error: 'pthread_mutex_init' was not declared in this scope; did you mean 'pthread_mutex_t'?
  172 |   pthread_mutex_init(&mutex_lock_,NULL);
      |   ^~~~~~~~~~~~~~~~~~
      |   pthread_mutex_t
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp: In member function 'void LogModule::RealseLock()':
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp:180:9: error: 'pthread_mutex_unlock' was not declared in this scope; did you mean 'pthread_mutex_t'?
  180 |         pthread_mutex_unlock(&mutex_lock_);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         pthread_mutex_t
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp: In member function 'void LogModule::Lock()':
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp:188:9: error: 'pthread_mutex_lock' was not declared in this scope; did you mean 'pthread_mutex_t'?
  188 |         pthread_mutex_lock(&mutex_lock_);
      |         ^~~~~~~~~~~~~~~~~~
      |         pthread_mutex_t
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp: In member function 'void LogModule::UnLock()':
/home/pi/ldlidar_ros2_ws/src/ldlidar_stl_ros2/ldlidar_driver/src/logger/log_module.cpp:196:9: error: 'pthread_mutex_unlock' was not declared in this scope; did you mean 'pthread_mutex_t'?
  196 |         pthread_mutex_unlock(&mutex_lock_);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         pthread_mutex_t
gmake[2]: *** [CMakeFiles/ldlidar_stl_ros2_node.dir/build.make:132: CMakeFiles/ldlidar_stl_ros2_node.dir/ldlidar_driver/src/logger/log_module.cpp.o] Fehler 1
gmake[2]: *** Es wird auf noch nicht beendete Prozesse gewartet....
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/ldlidar_stl_ros2_node.dir/all] Fehler 2
gmake: *** [Makefile:146: all] Fehler 2
---
Failed   <<< ldlidar_stl_ros2 [12.7s, exited with code 2]

Summary: 0 packages finished [13.0s]
  1 package failed: ldlidar_stl_ros2
  1 package had stderr output: ldlidar_stl_ros2
```
Trouble launching moveit2 configurations

Hi I am using ROS2 humble with moveit2. I created a configuration with setup_assistant of moveit2. However, when I try to launch the demo launch file created by it. It gaves me the error:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'

I could not find anything related to capabilities. What does it mean? May someone please help me?
What is the alternative to a <ros2arduino.h>

I am using Arduino Mega.

I wanted to configure it to create a ros2 topic using the ros2arduino header.

However, I found out that the header cannot be used because it can only be supported from 32bit or higher

In this case, what idea can you recommend?

Currently, the board is connected to I2C communication, and it seems that the main board will also be connected to Arduino through I2C communication. (Currently, I am connecting from Ubuntu installed on my PC for testing purposes.)

Thank you so much for reading.
How to add an additional argument in a ROS2 cpp callback

I want to add an additional argument in a callback function for rclcpp, e.g. callback(msg, additional_argument).

I can do it in python. There the solution would be:

import rclpy
from std_msgs.msg import String

def callback(data, source):
    rospy.loginfo(f"I heard '{data.data}' from {source}")

def listener():
    rclpy.init()
    node = rclpy.create_node('listener')

    node.create_subscription(String, 'chatter_1', lambda msg: callback(msg, 1), 10)
    node.create_subscription(String, 'chatter_2', lambda msg: callback(msg, 2), 10)

    rclpy.spin(node)
    node.destroy_node()
    rclpy.shutdown()

if __name__ == '__main__':
    listener()
I also did it in ROS1 with boost::bind. I tried to do it in ROS2 with std::bind, but it did not work.

Does someone know the exact syntax?
ros2_control - Hardware Interface - Write() & Moveit2 Joint Trajectory

By using ROS Humble, Moveit2, and ros2_control, I am trying to accomplish manipulation tasks with the CRX-10iA/L Fanuc robot. Currently, I am implementing ros2_control hardware_interface part. Inside the default write function I am sending motion commands to robot.

I have two motion command options from the provided robot interface. One of them should be sent except the last write command and the other one must be sent lastly. Otherwise, communication can't go further.

I was wondering whether I can access to the total number of write commands that will be sent by hardware_interface? Then I can set a simple if-else logic.

I thought about accessing total number of joint trajectory commands but I realized that when moveit generated a joint trajectory point with 22 positions, write() function was called 5 times in hardware_interface. Less than ideal as expected due to real hardware constraints.

Any suggestion is appreciated. Thank you for your time.
ROS2 - modify py launchfile without rebuilding package

In ROS1 we could modify XML launchfile and roslaunch them directly without catkin_make rebuilding, in ROS2 it seems if I modify python launchfile, I need to rebuild the package otherwise

ros2 launch <package_name> <launchfile_name>
runs the old launchfile. Do I need to rebuild the package after each modification or am I missing something?
Comparison of trajectories from odometries

Is there a way in ROS2 to compare trajectories from odometry data? I'm using robot_localization to calculate various odometry outputs by incorporating GPS and IMU data. I have a bag file where I recorded odometry topics, and I would like to compare the paths taken in the following configurations:

/odom_local (odometry + IMU)
/odom_global (odometry + IMU + GPS)
/odom_ackermann (only my odometry data)
I can visualize the trajectories in rviz2, but I also want to compare them in terms of distance error, etc.

If someone has already done this, I hope they can assist me.

Thanks in advance.
Comparing navigation algorithms

I am new to Nav2 stack and currently there are a bunch of navigation plugins to choose from (https://navigation.ros.org/plugins/index.html). I am interested in how to choose available algorithms from those in "Planners" and "Controllers" sections. For example, how to know pros & cons of NavFn planner compared with SmacPlanner. How to know pros & cons of DWB controller against TEB controller. Is there any site clarify something like this?

Thank you,

Peera
Trouble Installing ROS 2 Humble on Ubuntu 20.04 with arm64/x86_64 Architecture

I've been encountering an issue while attempting to install ROS 2 Humble on my Ubuntu 20.04 system. My machine supports both arm64 and x86_64 architectures. Despite following the official installation instructions closely, I run into the "unable to locate package ros-humble-desktop" error every time I try to execute the installation command.

Here are the steps I've followed based on the instructions from the ROS.org page for Humble:

1. Added the ROS 2 repository and keyring as follows:

sudo apt update && sudo apt install curl -y

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
2. Updated and upgraded my package lists:

   sudo apt update
   sudo apt upgrade
3. Attempted to install ROS 2 Humble packages:

   sudo apt install ros-humble-desktop
However, this results in the "unable to locate package ros-humble-desktop" error.

Interestingly, I came across a similar issue on ROS Answers where a user encountered package location errors due to their system running on an ARMhf platform. However, after checking my system using dpkg --print-architecture and lscpu, I confirmed that my system is on arm64 and x86_64, which should be compatible with ROS 2 Humble according to REP 2000.

I'm reaching out to see if anyone has faced a similar issue or could offer guidance on resolving this error. Could this problem be related to my prior attempts to uninstall ROS 2 Foxy and clean my system? Or is there something else I'm missing in the setup process for ROS 2 Humble on Ubuntu 20.04?

Any advice or suggestions would be greatly appreciated. Thank you in advance for your help!
How to use ros2_control with actual hardware communicating via etherCAT?

I am learning ros2_control with the real hardware. I need some help writing hardware interface for the current setup. I do not have experience writing on the communication side of the real hardware.

setup: I have Jetson nano, drives, motors, and sensors communicating via EtherCAT and using ros2 foxy and SOEM_ROS2 package. these were installed and running without ros2 control, simply via publisher and subscriber. The whole system controls the x,y,z axis with prismatic joint. It is not a robot. so no end effector. Now, I want to integrate ros2 control with the whole system. I don't know how to get the values from the hardware for the read and write methods of the hardware interface. I appreciate any help you can provide.
Reading a ros2_control xacro file in a regular node

I have a xacro file that I used for a specific piece of hardware. I figured out how to store custom data structures within the gpio framework within ros2_control

example:

    <gpio name="motion_command_output">
        <param name="byteIndex">0</param>
        <param name="bitMask">0x01</param>
    </gpio>
This would get automatically loading into the associated plugin and the data was available in the hardwareinfo structure/map.

I want to use the same xacro file but in a regular lifecycle node. It seems that I can read and parse the file in the launch file with

    device_config = xacro.process_file(io_config_file_path)
    device_config_parsed = device_config.toprettyxml(indent='  ')
But there isn't really a way to load that into the parameters.

I have tried a bunch of different options and it blows up or nothing happens. Another option would be just to parse the file in the node with tinyxml2.

Any ideas?

Thanks
Custom hardware interface type

I would like to write a controller that needs all joint states to update a single joint.

My idea was to create a class MyStateInterface which inherits from hardware_interface::StateInterface and stores all information for each joint. Then, I would like to export this class inside the hardware interface to pass the joint information to the controller.

To make it clear, I modify this example:

std::vector<double> hw_states_;

CallbackReturn MyRobotHardware::on_init(const hardware_interface::HardwareInfo & info) {
  // set some default values when starting the first time
  hw_states_.resize(info_.joints.size(), 0.0);
  return CallbackReturn::SUCCESS;
}

std::vector<hardware_interface::StateInterface>
MyRobotHardware::export_state_interfaces()
{
  std::vector<hardware_interface::StateInterface> state_interfaces;

  for (uint i = 0; i < info_.joints.size(); i++)
  {
    state_interfaces.emplace_back(hardware_interface::StateInterface(
      info_.joints[i].name,                  // joint name from controller.yaml
      hardware_interface::HW_IF_POSITION,    // "position"
      &hw_states_[i]                         // the joint value
    ));
  }

  return state_interfaces;
}
To something like this:

std::vector<MyStateHandle> hw_states_;

CallbackReturn MyRobotHardware::on_init(const hardware_interface::HardwareInfo & info) {
  // set some default object when starting the first time
  hw_states_.resize(info_.joints.size(), MyStateHandle());
  return CallbackReturn::SUCCESS;
}

std::vector<hardware_interface::StateInterface>
MyRobotHardware::export_state_interfaces()
{
  std::vector<hardware_interface::StateInterface> state_interfaces;

  for (uint i = 0; i < info_.joints.size(); i++)
  {
    state_interfaces.emplace_back(hardware_interface::StateInterface(
      info_.joints[i].name,      // joint name from controller.yaml
      "my_state_handle",         // a made up name
      &hw_states_[i]             // information for controlling the joint
    ));
  }

  return states_interfaces;
}
This didn't work because there is no matching function for the call hardware_interface::StateInterface(const std::string &name, const std::string &interface_name, MyStateHandle *value_ptr=nullptr) because there is only the function hardware_interface::StateInterface(const std::string &name, const std::string &interface_name, double *value_ptr=nullptr)

I want to know if there is a way to pass a class full of control data from the hardware interface to the controller, or am I on a completely wrong track?
Octomap and Projected Octomap not lining up

I am trying to use a projected Octomap as an occupancy grid to pass onto the ROS navigation stack, but when I create one using the octomap_server package, it creates an occupancy grid which is rotated 90 degrees from the top down view (i.e., It projects from the side when it should be projecting downwards). The Octomap and the projected Octomap are shown below.

Is there any way to change the direction from which Octomap creates the projection?
Controlling power input for different currents and voltages connected to the same power source

I am new to robotics and am struggling with the electronics a bit. I am using two 9 V batteries in series to provide 18 V. I need to power 2 x 12 W DC motors and an Arduino Uno. I need to divide the input power of 18 volts into 3 streams: 2 x (12 V, 1 A) streams for the motors + 1 x (6 V, 0.2 A) for the Arduino.

I thought of using a 1 Ω resistor and a 2 Ω resistor in parallel to get two streams: 12 volts and 6 volts respectively, but I am not sure if that will ensure the right current values will be drawn. I tried looking online but couldn't find a method. How can I go about carrying this out? Any help will be greatly appreciated!
Subscriber in Hardware Interface (ros2_control)

Is there any example for adding subscriber to hardware interface ? Publisher works fine. My code is below, I dont know where its going wrong but unable to get values after publishing using CLI.

.hpp file '''

namespace diffdrive_ctre { class HardwareCommandPub : public rclcpp::Node { public:

HardwareCommandPub();
void publishData();
void pincmdcheck();
private: rclcpp::Publisher<amr_v4_msgs_srvs::msg::Motor>::SharedPtr pub_; rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr estop_pub_; rclcpp::Subscription<amr_v4_msgs_srvs::msg::Pin>::SharedPtr pin_sub_; rclcpp::TimerBase::SharedPtr timer_; amr_v4_msgs_srvs::msg::Pin latest_pin_cmd; };

class DiffDriveCTREHardware : public hardware_interface::SystemInterface {

''' .cpp file

HardwareCommandPub::HardwareCommandPub() : Node("Motor_Status") {

pub_ = this->create_publisher<amr_v4_msgs_srvs::msg::Motor>("talonFX_right/status", 10); estop_pub_ = this->create_publisher<std_msgs::msg::Bool>("/e_stop", 10); pin_sub_ = this->create_subscription<amr_v4_msgs_srvs::msg::Pin>("/amr/pin_cmd", 10, [this](const amr_v4_msgs_srvs::msg::Pin::SharedPtr pin_cmd) { latest_pin_cmd = *pin_cmd; });

}

void HardwareCommandPub::publishData() { // //motor1 auto message = amr_v4_msgs_srvs::msg::Motor(); message.temperature_right = motor_right.GetDeviceTemp().ToString(); message.bus_voltage_right = motor_right.GetSupplyVoltage().ToString();
message.output_current_right = motor_right.GetStatorCurrent().ToString(); message.error_right = motor_right.GetStickyFault_Hardware().ToString();

// //motor2 message.temperature_left = motor_left.GetDeviceTemp().ToString(); message.bus_voltage_left = motor_left.GetSupplyVoltage().ToString();
message.output_current_left = motor_left.GetStatorCurrent().ToString(); message.error_left = motor_left.GetStickyFault_Hardware().ToString();

// //motor pin   message.temperature_pin = pin_motor.GetDeviceTemp().ToString();   message.bus_voltage_pin =
pin_motor.GetSupplyVoltage().ToString(); message.output_current_pin = pin_motor.GetStatorCurrent().ToString(); message.error_pin = pin_motor.GetStickyFault_Hardware().ToString();

//estop auto message_estop = std_msgs::msg::Bool();
message_estop.data = estop_temp; if (rclcpp::ok()) { estop_pub_->publish(message_estop); pub_->publish(message); pincmdcheck(); } }

void HardwareCommandPub::pincmdcheck() { pin_temp = latest_pin_cmd.pin_command; RCLCPP_INFO( rclcpp::get_logger("Pin test"), "Got pin cmd '%i'and '%i' and '%s'!",pin_temp,latest_pin_cmd.pin_command); }
How to make 4 wheeled robot work with DiffDrive plugin and ROS2 Control?

I have a 4 wheeled robot with mecanum wheels (in real life), I have been able to simulate it and get it to work with the ROS2 DiffDrive plugin (replicating the skid steer plugin from ROS1) but now that I want to implement ROS2 Control with it I cannot get it to work. I have been following the Articubot tutorials but his robot only has 2 wheels. I can't find anything online regarding a 4 wheeled robot that would make use of the DiffDrive plugin on ROS2 while using ROS2 Control. At the moment My aim is to only simulate the robot in gazebo so that I can better understand how ROS2 control works but I am stuck.

GitHub Repo

I hope the question is clear.

Some guidance on how to make ROS2 Control work with this robot with be very much appreciated. Thanks
Underwater Property Simulation with ROS2 e.g Particle Plume

I want to develop and test adaptive path planning algorithms for AUVs or also USVs.

So far I did this in ROS1 with the UUV Simulator and especially the uuv_plume_simulator.

Now I am looking for ways to do this in ROS2.

I managed to get a simulation of an AUV working with ROS2 Humble and Gazebo Ignition but I couldn't find a solution comparable to the UUV Plume Simulator.

Are there Gazebo (Ignition/Garden/Harmonic) Plugins or Projects that already deal with the simulation of the distribution of water properties like salinity/turbidity/temperature or the simulation of freshwater/hotwater/oil/particle spill or plumes? Ideally these properties would be also influenced by currents.

So far i only came across the EnvironmentPreload Plugin for Gazebo Harmonic but it seems to only offer the a static distribution of values.

Any recommendations are highly appreciated.
ros_gz_bridge does not publish on ros2 topic

I am running ros_gz_bridge to read some data from Gazebo, in particular I have run:

ros2 run ros_gz_bridge parameter_bridge /model/x500_vision_0/odometry@nav_msgs/msg/Odometry[gz.msgs.Odometry

[INFO] [1706113773.667589591] [ros_gz_bridge]: Creating GZ->ROS Bridge: [/model/x500_vision_0/odometry (gz.msgs.Odometry) -> /model/x500_vision_0/odometry (nav_msgs/msg/Odometry)] (Lazy 0)
The problem is that when I run

ros2 topic echo /model/x500_vision_0/odometry
I do not see any message published on the topic.

I have already checked that the name of the topic is correct, and when I run

gz topic -et /model/x500_vision_0/odometry
I can see the messages exchanged within Gazebo.

So why is the bridge not publishing the messages on the ROS2 network?
Compilation error when subscription callback's input is of certain type

I did an experiment where I tried all combinations of const, &, and SharedPtr as the input to the subscription callback. The message type is nav_msgs::msg::Odometry and the results are at the bottom of the code snippet.

#include "rclcpp/rclcpp.hpp"
#include "nav_msgs/msg/odometry.hpp"

class SubToSharedPtr : public rclcpp::Node
{
public:
    SubToSharedPtr()
    : Node("sub_to_shared_ptr_node")
    {
        odom_sub_ = this->create_subscription<nav_msgs::msg::Odometry>(
            "odom", rclcpp::SystemDefaultsQoS(),
            std::bind(&SubToSharedPtr::odomCb, this, std::placeholders::_1)
        );
    }

private:
    rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr odom_sub_;

    void odomCb(const nav_msgs::msg::Odometry& msg)
    {

    }
};

int main(int argc, char** argv)
{
    rclcpp::init(argc, argv);
    auto node = std::make_shared<SubToSharedPtr>();
    rclcpp::spin(node);
    rclcpp::shutdown();
    return 0;
}

// const SharedPtr& - doesn't work
// const SharedPtr - works
// SharedPtr - works
// SharedPtr& - doesn't work
// const & - works
// const - works
// & - doesn't work
// nothing - works
It seems like there is an important implication to this pattern (maybe something to do with ownership?). For example, all the ones with & doesn't work except for const & maybe because even though you are getting the actual variable (not a copy) you are promising not to change it, which is why it's acceptable.

Does anyone have an explanation for why this pattern exists?
Are hardware components in ros2_control designed to include a ROS 2 node as a member?

I need to transmit high-level status updates strings about my hardware to another node using a publisher. Recognizing that blocking calls are not welcome within the read/write methods, I intend to employ a Node in conjunction with RealtimePublisher from the realtime_tools package. However, I'm uncertain whether it is possible to instantiate a node within the implementation of the SystemInterface.
Oriented Bounding Box in RVIZ

I want to visualize an OrientedBoundingBox from Open3D on RVIZ, I have seen the :

RvizVisualTools::publishWireframeRectangle
RVIZ Line Segments
publishWireframeRectangle has two dimensions width, and height, while I still have length, and for RVIZ Line Segment I have to develop the function myself, I wonder if there is a ready to use function to publish RVIZ Marker for OrientedBoundingBox which is ready to use, can you please tell me if there is any? thanks in advance.