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

[ros2run]: Process exited with failure 3221226505

asked 2023-06-14 10:58:08 -0600

buckley.toby gravatar image

updated 2023-06-14 11:37:57 -0600

No clue what this error code means.

System: Windows 10 ROS Humble

Github repo with my code (forked from robosavvy's vive_ros):
https://github.com/NU-Haptics-Lab/ope...

I've tried setting my ROS_DOMAIN_ID and nothing changes.

edit retag flag offensive close merge delete

Comments

just a note to anyone reading this in the future: that failure code is a generic Windows failure code.

buckley.toby gravatar image buckley.toby  ( 2023-06-27 10:55:36 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-15 14:44:23 -0600

buckley.toby gravatar image

I figured it out:

Since I was porting the code from ROS1, they initiated their node like this:

class OPEN_VRnode
{
  public:
    OPEN_VRnode(int rate);
    ~OPEN_VRnode();
    bool Init();
    void Run();
    void Shutdown();
    bool setOriginCB(const std::shared_ptr<std_srvs::srv::Empty::Request> req, std::shared_ptr<std_srvs::srv::Empty::Response> res);
    void set_feedback(const sensor_msgs::msg::JoyFeedback::ConstPtr msg);
    rclcpp::Node:: nh_;
    VRInterface vr_;

...

OPEN_VRnode::OPEN_VRnode(int rate)
  : loop_rate_(rate)
  , nh_("open_vr_node")
  , vr_()
  , world_offset_({0, 0, 0})
  , world_yaw_(0)
{

But this resulted in no shared_ptr being created, so then later in the code when I ran rclcpp::spin_some(nh_.get_shared_from_this()); there was no valid shared ptr to pass to spin_some.

Fixed the issue by changing nh_ to nh_ptr_ and the type from rclcpp::Node to rclcpp::Node::SharedPtr and then initializing it in the class constructor.

Full code can be found on my repository:
https://github.com/NU-Haptics-Lab/ope...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-06-14 10:58:08 -0600

Seen: 1,111 times

Last updated: Jun 15 '23