MartinStokroos / nexus_base_ros

ROS wheelbase controller for the NEXUS Omni 4-Wheeled Mecanum Robot.
MIT License
20 stars 6 forks source link

Issues with libraries #2

Closed phiger90 closed 3 years ago

phiger90 commented 3 years ago

Hello, thank you for developing this repo!

I am running Noetic and having some issues compiling the Arduino code.

When following the steps I first get fatal error: nexus_base_ros/Encoders.h: No such file or directory. I tried the fix that was recommended on the master branch:

cd build/ make -j4 nexus_base_ros cd .. catkin_make

This still generated the same issue. I found the missing libraries in ros_catking_ws/devel/include/nexus_base_ros/

I tried to use the absolute path to this location in my Arduino sketch (I also tried to simply copy the libraries to my Arduino/libraries folder.

Now I am able to find the libraries, but instead I get the following error:

"nexus_base_ros/Encoders.h:9:10: fatal error: string: No such file or directory

include

      ^~~~~~~~

compilation terminated. exit status 1 Error compiling for board Arduino Duemilanove or Diecimila."

Thank you in advance,

BR

phiger90 commented 3 years ago

Update:

When I run the command: rosrun rosserial_arduino make_libraries.py . In my Arduino/libraries folder I seem to be able to build everything except the nexus_base_ros libraries:

Error msg:

"Messages: Unable to build message: nexus_base_ros/Encoders Unable to build message: nexus_base_ros/Motors Encoders,Motors,Exporting nexus_base_ros

Services: Unable to build service: nexus_base_ros/ArmingEnable Unable to build service: nexus_base_ros/EmergencyStopEnable ArmingEnable,EmergencyStopEnable, "

phiger90 commented 3 years ago

I've managed to get it working. I reinstalled Arduino, removed all old libraries and started over. Still got the errors, ran the "make -j4 nexus_base_ros" command. Then again did catkin_make, sourced the setup.bash and reran "rosrun rosserial_arduino make_libraries.py ." . Now it seems to be working. I had to modify the nexus_base_controller.cpp as my robot was moving in the wrong directions. I moved the negative sign from the cmd_wheel_leftfront and rear to the right wheels instead (lines 177-184), now the robots is moving correctly (maybe the directions of my wires are different).

Again, than you so much for this project, really nice!!

MartinStokroos commented 3 years ago

Thanks for reporting your findings! I also noticed myself that some wiring can be interchanged between different platforms causing wrong directions or unstable control loops (positive feedback).