Ask Your Question
0

Error: Reset is not a member of um7

asked 2021-07-16 08:24:12 -0500

Fxaxo gravatar image

updated 2021-07-21 07:16:25 -0500

I use an Raspberry Pi4 Model b with the Operation system Ubuntu 20.04 and Ros Vers. 1. I tried to use an um7_driver wich i downloaded from Github.com ( https://github.com/Isaac25silva/Drive... ) but when i use the command catkin_make i receive these errors in the question ...

/home/ubuntu/um7_driver/src/um7/src/main.cpp:529:63: error: ‘Reset’ is not a member of ‘um7’
  529 |        ros::ServiceServer srv = imu_nh.advertiseService<um7::Reset::Request, um7::Reset::Response>(
      |                                                              ^~~~~

This is the relevant part in my Main.cpp i included the library comms.h in the beginnning

  // Real Time Loop
  bool first_failure = true;

  while (ros::ok())
  {
    try
    {
      ser.open();
    }
    catch (const serial::IOException& e)    // command to catch the error
    {
        ROS_WARN("um7_driver was unable to connect to port %s.", port.c_str());
    }
   if (ser.isOpen())
    {
      ROS_INFO("um7_driver successfully connected to serial port %s.", port.c_str());
      first_failure = true;
      try
      {
        um7::Comms sensor(&ser);
        configureSensor(&sensor, &private_nh);
        um7::Registers registers;
        ros::ServiceServer srv = imu_nh.advertiseService<um7::Reset::Request, um7::Reset::Response>(
           "reset", boost::bind(handleResetService, &sensor, _1, _2));
    std::cout<<("reset");
        while (ros::ok())
        {
          // triggered by arrival of last message packet
          if (sensor.receive(&registers) == TRIGGER_PACKET)
          {
            // Triggered by arrival of final message in group.
            imu_msg.header.stamp = ros::Time::now();
            publishMsgs(registers, &imu_nh, imu_msg, axes, use_magnetic_field_msg);
            ros::spinOnce();
          }
        }
      }
      catch(const std::exception& e)
      {
        if (ser.isOpen()) ser.close();
        ROS_ERROR_STREAM(e.what());
        ROS_INFO("Attempting reconnection after error.");
        ros::Duration(1.0).sleep();
      }
    }
    else
    {
      ROS_WARN_STREAM_COND(first_failure, "Could not connect to serial device "
                           << port << ". Trying again every 1 second.");
      first_failure = false;
      ros::Duration(1.0).sleep();
    }
  }
edit retag flag offensive close merge delete

Comments

1

I suggest you

  1. remove the serialization.h file content, as this is a file from the ROS distribution
  2. post the error message you get in the question with some context (please format it using the button with 101010 on it) and
  3. post the (relevant) part of your main.cpp

by editing your question. Thank you.

mgruhler gravatar image mgruhler  ( 2021-07-16 08:53:53 -0500 )edit

please specify from which repository you downloaded the driver. I.e. link to the repo on GitHub, not only to the GitHub main page...

Most probably, the Service that is used in the source file has not yet been built.

mgruhler gravatar image mgruhler  ( 2021-07-21 06:11:06 -0500 )edit

srry you r right i added the link in the question !

hm that means i should try an different driver ?

Fxaxo gravatar image Fxaxo  ( 2021-07-21 07:17:27 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-07-21 07:59:30 -0500

mgruhler gravatar image

Yes, you should use another driver.

The Readme of the library states:

Driver for the CH Robotics UM7 inertial measurement device without ROS.

They seem to have forked a ROS driver and removed all ROS related part in the code and the CMakeLists.txt. This is why the messages aren't built. I would suggest to try the one in ros-drivers. Though this does not seem to be supported in noetic...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-07-16 08:24:12 -0500

Seen: 51 times

Last updated: Jul 21 '21