Giter Club home page Giter Club logo

Comments (13)

twdragon avatar twdragon commented on August 11, 2024

Now it is sadly not a priority task for me. To help with this, you also can participate by trying to compile the forked branch of the repository on ROS2 and reporting the errors here or in the dedicated issues, so we would easily discover incompatibilities

from witmotion_imu_ros.

fllay avatar fllay commented on August 11, 2024

I have tried but the submodule create a problem.

pi@pi-desktop:~/amr_ws$ colcon build --packages-select witmotion_ros --symlink-install
Starting >>> witmotion_ros
--- stderr: witmotion_ros                         
CMake Error at CMakeLists.txt:12 (message):
  witmotion-uart-qt directory does not contain submodule data.  Please update
  submodules to compile the underlying library in-place for ROS integration


---
Failed   <<< witmotion_ros [0.25s, exited with code 1]

Summary: 0 packages finished [1.20s]
  1 package failed: witmotion_ros
  1 package had stderr output: witmotion_ros

The code was generated by using

Is it possible to remove submodule? Just include everything in one repo. Thank you

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

@fllay did you try:

git submodule update --init --recursive

before compiling? The submodule is necessary to separate versions of the node and the library.

from witmotion_imu_ros.

fllay avatar fllay commented on August 11, 2024

I tried

git submodule update --init --recursive

It can be build now but I still get error

Starting >>> witmotion_ros
--- stderr: witmotion_ros                         
CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5SerialPort"
  with any of the following names:

    Qt5SerialPortConfig.cmake
    qt5serialport-config.cmake

  Add the installation prefix of "Qt5SerialPort" to CMAKE_PREFIX_PATH or set
  "Qt5SerialPort_DIR" to a directory containing one of the above files.  If
  "Qt5SerialPort" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  witmotion-uart-qt/CMakeLists.txt:30 (find_package)


---
Failed   <<< witmotion_ros [1.74s, exited with code 1]

Summary: 0 packages finished [3.13s]
  1 package failed: witmotion_ros
  1 package had stderr output: witmotion_ros

Then I install sudo apt-get install libqt5serialport5-dev. I still git this error

--- stderr: witmotion_ros                         
CMake Error at CMakeLists.txt:54 (find_package):
  By not providing "FindSerialPort.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "SerialPort", but CMake did not find one.

  Could not find a package configuration file provided by "SerialPort" with
  any of the following names:

    SerialPortConfig.cmake
    serialport-config.cmake

  Add the installation prefix of "SerialPort" to CMAKE_PREFIX_PATH or set
  "SerialPort_DIR" to a directory containing one of the above files.  If
  "SerialPort" provides a separate development package or SDK, be sure it has
  been installed.


---
Failed   <<< witmotion_ros [5.78s, exited with code 1]

Summary: 0 packages finished [6.73s]
  1 package failed: witmotion_ros
  1 package had stderr output: witmotion_ros

Is this the roserial package in ros1?

from witmotion_imu_ros.

kyuhyong avatar kyuhyong commented on August 11, 2024

I actually implemented the driver for ROS 2 based on https://github.com/Rophier/WIT-IMU here.
Here is my implementation of the same sensor.
https://github.com/kyuhyong/WIT-IMU

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

@fllay yes, there is rosserial package which is not actually used in this package.

@kyuhyong do you have a possibility to change the output rate in your driver?

from witmotion_imu_ros.

fllay avatar fllay commented on August 11, 2024

@twdragon Thank you. Now I can fix that issue and I am re-writing ros2 pub but I don't know it will be ok or not.

@kyuhyong Thank you I will give it a try. I have only WT61C TTL and it does not work out of the box. I ordered
WT901C and will see.

BTW WT61C TTL works with witmotion_IMU_ros without any modification. Just edit the config file and It is very stable.

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

@fllay looking forward to see the PR from you. Really!

from witmotion_imu_ros.

fllay avatar fllay commented on August 11, 2024

I'm willing to PR but I don't know how to do PR or how PR works. I edited witmotion_ros.cpp and witmotion_ros.h to use ros2 service and publisher. It seems to be compiled OK but I have trouble with witmotion_ros_node.cpp. It complained about link error. I just used the following code in witmotion_ros_node.cpp

#include "witmotion_ros.h"

#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

void handle_shutdown(int s)
{
//    RCLCPP_INFO(->get_logger(),"Shutting down node...");
//    rclcpp::shutdown();
    QCoreApplication::exit(0);
}

int main(int argc, char * argv[])
{ 
    ROSWitmotionSensorController& controller = ROSWitmotionSensorController::Instance();
    controller.Start();
}

and the gave error message

/usr/bin/ld: CMakeFiles/witmotion_ros_node.dir/src/witmotion_ros_node.cpp.o: in function `main':
witmotion_ros_node.cpp:(.text+0x18c): undefined reference to `ROSWitmotionSensorController::Instance()'
/usr/bin/ld: witmotion_ros_node.cpp:(.text+0x198): undefined reference to `ROSWitmotionSensorController::Start()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/witmotion_ros_node.dir/build.make:4671: witmotion_ros_node] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/witmotion_ros_node.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< witmotion [1min 1s, exited with code 2]
                                     
Summary: 0 packages finished [1min 2s]
  1 package failed: witmotion
  1 package had stderr output: witmotion

I don't know how to fix this. I don't even start ros2 node yet. Any idea?

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

@fllay did you delete Instance() function? If not, did you link the underlying library properly via target_link_libraries?

The ROSWitmotionSensorController class is implemented as Mayers' singleton in thread-safe C++11 or later. Please check the linking between the libraries.

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

The pull request will request us to allow adding your code as a particular branch to our repository. After the colleagues approve, I will test and hold your contribution as part of the project/

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

@fllay I examined your pull request. You cancelled compilation of an underlying library and the ROS library, so there is nothing to link to the node. You should review CMakeLists.txt to allow the libraries to be compiled.

from witmotion_imu_ros.

twdragon avatar twdragon commented on August 11, 2024

Development of the ROS2 version moved to ros2 branch.

from witmotion_imu_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.