PDA

View Full Version : How to install a functional ROS with KevinO's hexapod_ros on a Raspberry 3?



SnowHead
09-30-2016, 02:55 PM
Hi guys,
at first sorry for my poor english, I'm a Kraut.
I wasted within the last weeks a lot of time trying to get KevinO's hexapod_ros-stack running on a Raspberry 3 for my PhantomX MKIII.
At the moment the ROS repository is quite inconsistent in my mind. I tried it with Jessie and Xenial, on a Raspi2 and a Raspi3, with Indigo and Kinetic, from source and precompiled, from the ros- and the ros-shadow-fixed repositories. Every time after a lot of work in all variants there came insurmountable barriers in form of undiscoverable packages, unresolvable dependencies, hard compiler errors within the sources or incompatible compiler options and so on.
There are a lot of tutorials in the web. But the most of them are outdated and the remaining tutorials causes the problems written before. I also tried the HowTo in the ROS-Wiki for Indigo and Kinetic without success.
For example I've need one week till I found a hint in the net, that ROS Indigo will not run on Raspi 3 but only on Raspi 2. For Raspi 3 only ROS Kinetic is working.
So I want to ask here for a working tutorial to install ROS and KevinO's stack an a Raspi (preferably a Raspi3). May be someone can provide a SD-card-image running in his PhantomX.
I'm more interested in making experiments with robots and programming them instead of the annoying and frustrating (and especially ineffective) tries to install a working robot stack.

My hardware:
- PhantomX MKIII (AX-12)
- Raspi 2 and Raspi 3
- Asus Xtion Pro Live
- IMU PhidgetSpatial 3/3/3 Basic
- audio amplifier and speaker for audio output of the Raspi
- no USB2AX but a logic for using the normal serial output of the Raspi for communication with the Dynamixel-servos
- wireless PS3-controller

Is there a chance to get this stack running on a Raspi 3 or must I downgrade to my Raspi 2? Does anyone have a working tutorial for this way inclusive the fitting compiler options and hints for unresolved dependencies, missing includes, undiscoverable packages and all the other nice banters within the ROS-repositories?

I would very appreciating if there is a hero in shining armor having a solution for this frustrating problem.

KurtEck
09-30-2016, 03:12 PM
I believe there has been another person installing the Kevin's ROS stack on RPI. So far I don't think it matters much if installing on RPI2 or RPI3 as I believe they use the same image. That is I don't believe thee are any 64 bit releases yet for RPI3.

What I don't remember is if they were using Debian or if they installed Ubuntu on their board.

If it were me, I would try installing Ubuntu on it: https://wiki.ubuntu.com/ARM/RaspberryPi

Then you should be able to do the same steps I did to install Rps Kinetic, which has support for Armf in pre built packages:
http://wiki.ros.org/kinetic/Installation/Ubuntu

Then you can probably do the same steps I did for Odroids in the posting: http://forums.trossenrobotics.com/showthread.php?6725-ROS-Hexapod-project-Golem-MX-64-4dof&p=72135#post72135

But maybe someone who has done it on RPI will chime in.

Good Luck

SnowHead
09-30-2016, 03:32 PM
Hi Kurt,
thank you for your hints. Till now I only tried the official Ubuntu-Raspi-distributions Jessie and Xenial from the raspi-homepage. I'll try this weekend this unofficial one.
But (for example) in the installation tutorial you linked is recommended the "ros-kinetic-desktop-full"-package. But this package is not available. So I tried in previous sessions to install the needed packages separate with the described problems with unresolvable dependencies and missing packages. For example for "rtabmap-ros" (needed by Kevins stack) there is a dependency to rviz. But I found no way to install rviz on a Raspi3. Always the old problem with missing packages and dependencies. Trying to install one package, there are needed a lot of other packages which also needs other packages by themself. This was a endless chain and I gave up frustrated.

KurtEck
09-30-2016, 03:47 PM
Again others are better at answering direct ROS stuff.

Yes - Full was not available, so I just installed desktop on the Odroid.

Now with ARM, things like gazebo and rviz don't work overly well (if at all), so most install these packages on a PC and setup for multiple processors...

So for example on my ODroid: I don't have it build the hexapod_gazebo part of the project. I do that by adding the file:
./src/hexapod_ros/hexapod_gazebo/CATKIN_IGNORE

Here is another thread talking about RPI: http://forums.trossenrobotics.com/showthread.php?8018-Dan-s-ROS-Journey&highlight=RPI3

KevinO
09-30-2016, 06:39 PM
R3n33 might have more direct insight since she's worked with Rpi more than myself but let me see what we can figure out with your issue.

So first off the package list on my github is only tested with Indigo, I'm currently using Kinetic and noticed that package grouping in the cases of ROS core packages has changed. For example, some things are now part of the desktop install that were not before. Like navigation is included in the desktop now. Sadly things like the sound-play package has build support dropped but will compile fine if you pull the source down and build it yourself.

The over arching good news is in all cases aside from sound-play, if it says that package is unavailable it usually means it is part of the desktop install. Even better news is I can confirm that the hexapod stack builds fine in kinetic.

Can you post the catkin errors? I can usually tell pretty quickly what's wrong with the build from those.

SnowHead
10-01-2016, 03:04 AM
@KurtEck
I already read this thread and will consider the hints to CATKIN_IGNORE and restart the compilation after 'Invoking "make -j4 -l4' failed" (I had this error too but did not restart the compiler).

@KevinO
Because I'll be afk till late evening today I'll try tomorrow installing the ros-kinetic-desktop on my Raspi3 with the Ubuntu recommended by Kurt. Afterwards I'll install the packages listed in your github (sound-play from source). Coming in problems I'll post the concrete error messages here.
A question in advance: what's the ominous "Start button" Dan was talking about?

KurtEck
10-01-2016, 07:56 AM
You need to press the Start button on the DS3 controller to get the robot to do anything.

Actually getting the DS3 to work at all on some processor boards can be a real pain in ...

SnowHead
10-01-2016, 05:27 PM
@KurtEck

Thx. I'va a cheap chinese controler with a separate USB-receiver (no bluetooth). This part I got to work and was able to check it with "jstest".


@All

I started the installation on my Raspi3.
The used system is xenial "ubuntu-mate-16.04-desktop-armhf-raspberry-pi" from here (https://ubuntu-mate.org/raspberry-pi/).
I was able to install ros-kinetic-desktop. Then I successfully installed audio_common for sound-play from source.
For the packages listed by Kevin the installation works fine. The meanwhile missed packages I found in the shadow-fixed repository.
The only problem is the navigation-package. It seems to be installed but will not be found:


$sudo apt-get ros-kinetic-navigation
...
ros-kinetic-navigation is already the newest version (1.14.0-0xenial-20160927-193330-0700)
...

$rospack find navigation
[rospack] Error: package 'navigation' not found

$ls -al /opt/ros/kinetic/share/ | grep navigation
drwxr-xr-x 2 root root 4096 Okt 1 23:37 navigation

$ls /opt/ros/kinetic/share/navigation
package.xml

I reinstalled the navigation-package with the same result. I hope this will not have negative effects running the robot.
Can this become a problem and can it be fixed?

The PS3-controller runs without problems in jstest.

Tomorrow I'll install the phidgets-driver. Must I also install OpenNI2 or are the libs installed with ros are sufficient for the planned functions?

In summary I can say that using the Ubuntu recommended by Kurt and switching from indigo to kinetic solved the problems I had before with the official Raspi-images an indigo.

Unfortunately my postman today took the packet with my robot back to the post office because I wasn't at home. I can it pick from the post office not before tuesday because next monday is a public holiday in Germany. Damn! But I'll keep you posted.

And another question to Kevin. I studied your xacro-files for the hexapod to learn how to adapt them to my robot. Especially the camera-links and -joints might be different. But I did not understand how you got the dimensions and positions of the links and joints. Especially the angles of the camera-frames are totally inscrutable for me. The wiki was no help for this very special cases. Could you make a glimpsed sketch, please, where to see how the dimensions for the links and joints for the camera has to be taken? This would be very helpful.

Till now I want to thank you very much for your support. I hope I'll get the robot alive without further problems.

SnowHead
10-02-2016, 08:05 AM
Hmm, it seems that I reported success overhasty. Trying to start the system I got errormessages from libphidgets and rtabmap:

libphidget

[ERROR] [1475410244.456080084]: Failed to load nodelet [/PhidgetsImuNodelet] of type [phidgets_imu/PhidgetsImuNodelet] even after refreshing the cache: According to the loaded plugin descriptions the class phidgets_imu/PhidgetsImuNodelet with base class type nodelet::Nodelet does not exist. Declared types are depth_image_proc/convert_metric depth_image_proc/crop_foremost depth_image_proc/disparity depth_image_proc/point_cloud_xyz depth_image_proc/point_cloud_xyz_radial depth_image_proc/point_cloud_xyzi depth_image_proc/point_cloud_xyzi_radial depth_image_proc/point_cloud_xyzrgb depth_image_proc/register depthimage_to_laserscan/DepthImageToLaserScanNodelet hexapod_sound/hexapod_sound hexapod_teleop_joystick/hexapod_teleop_joystick image_proc/crop_decimate image_proc/crop_nonZero image_proc/debayer image_proc/rectify imu_filter_madgwick/ImuFilterNodelet nodelet_tutorial_math/Plus openni2_camera/OpenNI2DriverNodelet pcl/BAGReader pcl/BoundaryEstimation pcl/ConvexHull2D pcl/CropBox pcl/EuclideanClusterExtraction pcl/ExtractIndices pcl/ExtractPolygonalPrismData pcl/FPFHEstimation pcl/FPFHEstimationOMP pcl/MomentInvariantsEstimation pcl/MovingLeastSquares pcl/NodeletDEMUX pcl/NodeletMUX pcl/NormalEstimation pcl/NormalEstimationOMP pcl/NormalEstimationTBB pcl/PCDReader pcl/PCDWriter pcl/PFHEstimation pcl/PassThrough pcl/PointCloudConcatenateDataSynchronizer pcl/PointCloudConcatenateFieldsSynchronizer pcl/PrincipalCurvaturesEstimation pcl/ProjectInliers pcl/RadiusOutlierRemoval pcl/SACSegmentation pcl/SACSegmentationFromNormals pcl/SHOTEstimation pcl/SHOTEstimationOMP pcl/SegmentDifferences pcl/StatisticalOutlierRemoval pcl/VFHEstimation pcl/VoxelGrid rtabmap_ros/data_odom_sync rtabmap_ros/data_throttle rtabmap_ros/disparity_to_depth rtabmap_ros/obstacles_detection rtabmap_ros/point_cloud_aggregator rtabmap_ros/point_cloud_xyz rtabmap_ros/point_cloud_xyzrgb rtabmap_ros/rgbd_odometry rtabmap_ros/stereo_odometry rtabmap_ros/stereo_throttle
[ERROR] [1475410244.458071781]: The error before refreshing the cache was: According to the loaded plugin descriptions the class phidgets_imu/PhidgetsImuNodelet with base class type nodelet::Nodelet does not exist. Declared types are depth_image_proc/convert_metric depth_image_proc/crop_foremost depth_image_proc/disparity depth_image_proc/point_cloud_xyz depth_image_proc/point_cloud_xyz_radial depth_image_proc/point_cloud_xyzi depth_image_proc/point_cloud_xyzi_radial depth_image_proc/point_cloud_xyzrgb depth_image_proc/register depthimage_to_laserscan/DepthImageToLaserScanNodelet hexapod_sound/hexapod_sound hexapod_teleop_joystick/hexapod_teleop_joystick image_proc/crop_decimate image_proc/crop_nonZero image_proc/debayer image_proc/rectify imu_filter_madgwick/ImuFilterNodelet nodelet_tutorial_math/Plus openni2_camera/OpenNI2DriverNodelet pcl/BAGReader pcl/BoundaryEstimation pcl/ConvexHull2D pcl/CropBox pcl/EuclideanClusterExtraction pcl/ExtractIndices pcl/ExtractPolygonalPrismData pcl/FPFHEstimation pcl/FPFHEstimationOMP pcl/MomentInvariantsEstimation pcl/MovingLeastSquares pcl/NodeletDEMUX pcl/NodeletMUX pcl/NormalEstimation pcl/NormalEstimationOMP pcl/NormalEstimationTBB pcl/PCDReader pcl/PCDWriter pcl/PFHEstimation pcl/PassThrough pcl/PointCloudConcatenateDataSynchronizer pcl/PointCloudConcatenateFieldsSynchronizer pcl/PrincipalCurvaturesEstimation pcl/ProjectInliers pcl/RadiusOutlierRemoval pcl/SACSegmentation pcl/SACSegmentationFromNormals pcl/SHOTEstimation pcl/SHOTEstimationOMP pcl/SegmentDifferences pcl/StatisticalOutlierRemoval pcl/VFHEstimation pcl/VoxelGrid rtabmap_ros/data_odom_sync rtabmap_ros/data_throttle rtabmap_ros/disparity_to_depth rtabmap_ros/obstacles_detection rtabmap_ros/point_cloud_aggregator rtabmap_ros/point_cloud_xyz rtabmap_ros/point_cloud_xyzrgb rtabmap_ros/rgbd_odometry rtabmap_ros/stereo_odometry rtabmap_ros/stereo_throttle
[PhidgetsImuNodelet-9] process has died [pid 2370, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load phidgets_imu/PhidgetsImuNodelet imu_manager __name:=PhidgetsImuNodelet __log:=/home/pi/.ros/log/33659838-8899-11e6-99db-b827ebdc8d38/PhidgetsImuNodelet-9.log].
log file: /home/pi/.ros/log/33659838-8899-11e6-99db-b827ebdc8d38/PhidgetsImuNodelet-9*.log

rtabmap

[ERROR] [1475410262.956420694]: Rtabmap: Parameter "LccBow/InlierDistance" doesn't exist anymore! You may look at this similar parameter: "Vis/InlierDistance"
[ERROR] [1475410262.977543536]: Rtabmap: Parameter "LccBow/MinInliers" doesn't exist anymore! You may look at this similar parameter: "Vis/MinInliers"
[ERROR] [1475410263.016945867]: Rtabmap: Parameter "LccIcp/Type" doesn't exist anymore! You may look at this similar parameter: "Reg/Strategy"
terminate called after throwing an instance of 'UException'
what(): [FATAL] (2016-10-02 14:11:14.594) Memory.cpp:1101::getNeighborsIdRadius() Condition (!referential.isNull()) not met!
[rtabmap/rtabmap-25] process has died [pid 2562, exit code -6, cmd /opt/ros/kinetic/lib/rtabmap_ros/rtabmap --delete_db_on_start odom:=/rtabmap/odometry/synchronized rgb/image:=/rtabmap/camera/rgb/image_rect_color depth/image:=/rtabmap/camera/depth_registered/image_raw rgb/camera_info:=/rtabmap/camera/depth_registered/camera_info scan:=/scan goal_out:=current_goal __name:=rtabmap __log:=/home/pi/.ros/log/33659838-8899-11e6-99db-b827ebdc8d38/rtabmap-rtabmap-25.log].
log file: /home/pi/.ros/log/33659838-8899-11e6-99db-b827ebdc8d38/rtabmap-rtabmap-25*.log



The logfile:

[0m[ INFO] [1475410251.751673366]: Starting node...[0m
[33m[ WARN] [1475410252.719349244]: rtabmap: "subscribe_laserScan" parameter is deprecated, use "subscribe_scan" instead. The scan topic is still subscribed.[0m
[0m[ INFO] [1475410253.073364020]: rtabmap: frame_id = base_link[0m
[0m[ INFO] [1475410253.074109741]: rtabmap: map_frame_id = map[0m
[0m[ INFO] [1475410253.074599371]: rtabmap: queue_size = 30[0m
[0m[ INFO] [1475410253.075060043]: rtabmap: tf_delay = 0.050000[0m
[0m[ INFO] [1475410253.075508320]: rtabmap: tf_tolerance = 0.100000[0m
[0m[ INFO] [1475410253.075956231]: rtabmap: depth_cameras = 1[0m
[0m[ INFO] [1475410253.079041770]: rtabmap: approx_sync = true[0m
[0m[ INFO] [1475410255.073509297]: Setting RTAB-Map parameter "Kp/MaxDepth"="4.0"[0m
[0m[ INFO] [1475410256.490454235]: Setting RTAB-Map parameter "Mem/RehearsalSimilarity"="0.30"[0m
[0m[ INFO] [1475410258.660818816]: Setting RTAB-Map parameter "RGBD/AngularUpdate"="0.01"[0m
[0m[ INFO] [1475410258.783744661]: Setting RTAB-Map parameter "RGBD/LinearUpdate"="0.01"[0m
[0m[ INFO] [1475410258.983265139]: Setting RTAB-Map parameter "RGBD/OptimizeFromGraphEnd"="true"[0m
[0m[ INFO] [1475410259.653563136]: Setting RTAB-Map parameter "Rtabmap/DetectionRate"="1"[0m
[0m[ INFO] [1475410260.114587739]: Setting RTAB-Map parameter "Rtabmap/TimeThr"="0"[0m
[33m[ WARN] [1475410263.024337870]: Rtabmap: Parameter name changed: "LccIcp2/CorrespondenceRatio" -> "Icp/CorrespondenceRatio". Please update your launch file accordingly. Value "0.2" is still set to the new parameter name.[0m
[33m[ WARN] [1475410263.756549989]: Rtabmap: Parameter name changed: "RGBD/LocalLoopDetectionSpace" -> "RGBD/ProximityBySpace". Please update your launch file accordingly. Value "true" is still set to the new parameter name.[0m
[33m[ WARN] [1475410263.865102764]: Rtabmap: Parameter name changed: "RGBD/PoseScanMatching" -> "RGBD/NeighborLinkRefining". Please update your launch file accordingly. Value "true" is still set to the new parameter name.[0m
[0m[ INFO] [1475410266.826158091]: RTAB-Map detection rate = 1.000000 Hz[0m
[0m[ INFO] [1475410266.827469431]: rtabmap: Deleted database "/home/pi/.ros/rtabmap.db" (--delete_db_on_start is set).[0m
[0m[ INFO] [1475410266.828157444]: rtabmap: Using database from "/home/pi/.ros/rtabmap.db".[0m
[0m[ INFO] [1475410269.264969075]: rtabmap: Database version = "0.11.8".[0m
[0m[ INFO] [1475410271.425857943]:
/rtabmap/rtabmap subscribed to:
/rtabmap/camera/rgb/image_rect_color,
/rtabmap/camera/depth_registered/image_raw,
/rtabmap/camera/depth_registered/camera_info,
/rtabmap/odometry/synchronized,
/scan[0m
[0m[ INFO] [1475410271.427240948]: rtabmap 0.11.8 started...[0m
[31m[FATAL] (2016-10-02 14:11:14.594) Memory.cpp:1101::getNeighborsIdRadius() Condition (!referential.isNull()) not met![0m



Trying the installation of libphidgets using this howto (http://wiki.ros.org/libphidgets) nothing happens after start of rosmake. All packets are skipped and no "build"-directory was created and so no installation was possible.


[email protected]:~/ros_catkin_ws$ rosmake libphidgets
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['libphidgets']
[ rosmake ] Logging to directory /home/pi/.ros/rosmake/rosmake_output-20161002-141338
[ rosmake ] Expanded args ['libphidgets'] to:
['libphidgets']
[rosmake-0] Starting >>> catkin [ make ]
[rosmake-0] Finished <<< catkin ROS_NOBUILD in package catkinive 0/19 Complete ]
No Makefile in package catkin
[rosmake-0] Starting >>> cmake_modules [ make ]
[rosmake-2] Starting >>> genmsg [ make ]
[rosmake-3] Starting >>> cpp_common [ make ]
[rosmake-0] Finished <<< cmake_modules ROS_NOBUILD in package cmake_modules
No Makefile in package cmake_modules
[rosmake-0] Starting >>> rospack [ make ]
[rosmake-0] Finished <<< rospack ROS_NOBUILD in package rospack
No Makefile in package rospack
[rosmake-0] Starting >>> roslib [ make ]
[rosmake-2] Finished <<< genmsg ROS_NOBUILD in package genmsg
No Makefile in package genmsg
[rosmake-2] Starting >>> genlisp [ make ]
[rosmake-3] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
No Makefile in package cpp_common
[rosmake-3] Starting >>> genpy [ make ]
[rosmake-1] Starting >>> gencpp [ make ]
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslibive 5/19 Complete ]
No Makefile in package roslib
[rosmake-0] Starting >>> geneus [ make ]
[rosmake-2] Finished <<< genlisp ROS_NOBUILD in package genlisp
No Makefile in package genlisp
[rosmake-1] Finished <<< gencpp ROS_NOBUILD in package gencpp
No Makefile in package gencpp
[rosmake-1] Starting >>> gennodejs [ make ]
[rosmake-2] Starting >>> rostime [ make ]
[rosmake-3] Finished <<< genpy ROS_NOBUILD in package genpy
No Makefile in package genpy
[rosmake-0] Finished <<< geneus ROS_NOBUILD in package geneusive 9/19 Complete ]
No Makefile in package geneus
[rosmake-2] Finished <<< rostime ROS_NOBUILD in package rostime
No Makefile in package rostime
[rosmake-1] Finished <<< gennodejs ROS_NOBUILD in package gennodejs
No Makefile in package gennodejs
[rosmake-1] Starting >>> message_generation [ make ]
[rosmake-2] Starting >>> roscpp_traits [ make ]
[rosmake-1] Finished <<< message_generation ROS_NOBUILD in package message_generation
No Makefile in package message_generation
[rosmake-2] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
No Makefile in package roscpp_traits
[rosmake-2] Starting >>> roscpp_serialization [ make ]
[rosmake-2] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization
No Makefile in package roscpp_serialization
[rosmake-2] Starting >>> message_runtime [ make ]
[rosmake-2] Finished <<< message_runtime ROS_NOBUILD in package message_runtime
No Makefile in package message_runtime
[rosmake-2] Starting >>> rosbuild [ make ]
[rosmake-2] Finished <<< rosbuild ROS_NOBUILD in package rosbuild
No Makefile in package rosbuild
[rosmake-2] Starting >>> mk [ make ]
[rosmake-2] Finished <<< mk ROS_NOBUILD in package mk
No Makefile in package mk
[rosmake-2] Starting >>> libphidgets [ make ]
[rosmake-2] Finished <<< libphidgets ROS_NOBUILD in package libphidgets
No Makefile in package libphidgets
[ rosmake ] Results:
[ rosmake ] Built 19 packages with 0 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/pi/.ros/rosmake/rosmake_output-20161002-141338

Trying to build libphidgets via "catkin_make" after a long, long build-time the compilation fails with:

[ 86%] Building CXX object CMakeFiles/dlib.dir/gui_widgets/base_widgets.o
/home/pi/ros_catkin_ws/src/cob_extern/libconcorde_tsp_solver/build/Qsopt/qsopt.a: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status
...
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

I've absolute no idea, what was my fault and how to fix this problems.
Are there any hints?

KurtEck
10-02-2016, 10:21 AM
Sorry, I can not directly answer either of these issues, as I don't have phidgets, I have razor and will transisition to BNO055.

Hopefully Kevin or maybe r3n33 can help. Also not sure how much of the time I ran with rtabitmap lauches.

Some hints, If I get something like, the invalid file format or the like, I often try: things like: catkin_make clean
To try to rebuild everything.

Other hint: Does your robot walk? That is I personally prefer to start by getting the basics working and then start adding things in as you need them.

So I would first start off with launching: hexapod_simple and see if you can get it to walk around with the PS2...

You can then see if the input controller works, and if the sound works and then IMU, and then ...

It's been awhile since I played with any of this stuff, but was earlier playing around with trying to decouple the servo driver from the main code. In some of my experiments, I created my own launch files that are setup for the PhantomX. Again you can do it without your own launch files, but you then need to add parameters to the launch, to get the stuff specific to the PhantomX...
I have that stuff in seperate fork/branch. These launch files are at: https://github.com/KurtE/hexapod_ros/tree/Servo_Driver_experiments/hexapod_bringup/launch

SnowHead
10-02-2016, 11:30 AM
Thank you for the hints. At the moment my robot is not walking but lounge around at the post office. I can pick it there not before tuesday.
After assembling it I'll make the first tries with the phoenix-code to check if all parts working. Then the ArbotixM will be exchanged with the Raspi.
I'll consider your hints for partial startup and check your repository.

The hint with "catkin_make clean" does not work. The same error message again after the the next compiler run.

KevinO
10-02-2016, 05:10 PM
Have you tried the one I use?

https://github.com/ccny-ros-pkg/phidgets_drivers

SnowHead
10-03-2016, 04:21 AM
I tried your link. But the problems didn't come from the phidgets_drivers but from the needed "libphidgets" (cob_extern). libphidgets are not available precompiled and must be build from source with the described problem:

/home/pi/ros_catkin_ws/src/cob_extern/libconcorde_tsp_solver/build/Qsopt/qsopt.a: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status
I removed the complete catkin workspace before, made a new one and got the same error.

SnowHead
10-03-2016, 04:27 AM
Update: I placed the flag CATKIN_IGNORE in the directory "/home/pi/ros_catkin_ws/src/cob_extern/libconcorde_tsp_solver/" and the build process succeeded.
The "PhidgetsImuNodelet" now starts without problems.
Now only the incompatible start parameters for rtabmap are left.

SnowHead
10-03-2016, 05:10 AM
Next update: I modified the start parameters in rtabmap.launch (one change was not reported but logged) and now are no more warnings on startup:

rtabmap.launch

<?xml version="1.0" encoding="UTF-8" ?>
<!-- rtabmap launch file -->

<launch>
<node pkg="nodelet" type="nodelet" name="depthimage_to_laserscan" args="load depthimage_to_laserscan/DepthImageToLaserScanNodelet camera/camera_nodelet_manager" >
<param name="scan_height" value="10" />
<param name="output_frame_id" value="body_link" />
<remap from="image" to="/camera/depth_registered/image_raw" />
<remap from="camera/image" to="/camera/depth_registered/image_raw" />
<remap from="camera/scan" to="scan" />
</node>
<group ns="rtabmap">
<!-- sync depth with odometry -->
<node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager"/>
<node pkg="nodelet" type="nodelet" name="data_odom_sync" args="load rtabmap_ros/data_odom_sync standalone_nodelet">
<remap from="odom_in" to="/odometry/calculated"/>
<remap from="rgb/image_in" to="/camera/rgb/image_rect_color"/>
<remap from="depth/image_in" to="/camera/depth_registered/image_raw"/>
<remap from="rgb/camera_info_in" to="/camera/depth_registered/camera_info"/>

<remap from="rgb/image_out" to="/rtabmap/camera/rgb/image_rect_color"/>
<remap from="depth/image_out" to="/rtabmap/camera/depth_registered/image_raw"/>
<remap from="rgb/camera_info_out" to="/rtabmap/camera/depth_registered/camera_info"/>
<remap from="odom_out" to="/rtabmap/odometry/synchronized"/>
</node>
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" args="--delete_db_on_start">
<param name="frame_id" type="string" value="base_link"/>
<remap from="odom" to="/rtabmap/odometry/synchronized"/>

<param name="subscribe_depth" type="bool" value="true"/>
<remap from="rgb/image" to="/rtabmap/camera/rgb/image_rect_color"/>
<remap from="depth/image" to="/rtabmap/camera/depth_registered/image_raw"/>
<remap from="rgb/camera_info" to="/rtabmap/camera/depth_registered/camera_info"/>

<param name="subscribe_laserScan" type="bool" value="true"/>
<remap from="scan" to="/scan"/>

<param name="queue_size" type="int" value="30"/>
<param name="publish_tf" type="bool" value="true"/>
<param name="map_filter_radius" type="double" value="0"/>
<remap from="goal_out" to="current_goal"/>

<!-- RTAB-Map's parameters -->
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="true"/>
<param name="Kp/MaxDepth" type="string" value="4.0"/>
<param name="Reg/Strategy" type="string" value="2"/>
<param name="Icp/CorrespondenceRatio" type="string" value="0.2"/>
<param name="Vis/MinInliers" type="string" value="5"/>
<param name="Vis/InlierDistance" type="string" value="0.1"/>
<param name="RGBD/AngularUpdate" type="string" value="0.01"/>
<param name="RGBD/LinearUpdate" type="string" value="0.01"/>
<param name="Rtabmap/TimeThr" type="string" value="0"/>
<param name="Mem/RehearsalSimilarity" type="string" value="0.30"/>
<param name="RGBD/NeighborLinkRefining" type="string" value="true"/>
<param name="Rtabmap/DetectionRate" type="string" value="1"/>
<param name="RGBD/NeighborLinkRefining" type="string" value="true"/>
<param name="RGBD/ProximityBySpace" type="string" value="true"/>
</node>
</group>
</launch>


But the exception always occures:

terminate called after throwing an instance of 'UException'
what(): [FATAL] (2016-10-03 11:55:22.588) Memory.cpp:1101::getNeighborsIdRadius() Condition (!referential.isNull()) not met!
[rtabmap/rtabmap-25] process has died [pid 28205, exit code -6, cmd /opt/ros/kinetic/lib/rtabmap_ros/rtabmap --delete_db_on_start odom:=/rtabmap/odometry/synchronized rgb/image:=/rtabmap/camera/rgb/image_rect_color depth/image:=/rtabmap/camera/depth_registered/image_raw rgb/camera_info:=/rtabmap/camera/depth_registered/camera_info scan:=/scan goal_out:=current_goal __name:=rtabmap __log:=/home/pi/.ros/log/65936810-894f-11e6-b4d2-b827ebdc8d38/rtabmap-rtabmap-25.log].
log file: /home/pi/.ros/log/65936810-894f-11e6-b4d2-b827ebdc8d38/rtabmap-rtabmap-25*.log

In the logfile there is no reason to see for this exception
logfile:

[0m[ INFO] [1475488944.738223527]: Starting node...[0m
[33m[ WARN] [1475488946.634565590]: rtabmap: "subscribe_laserScan" parameter is deprecated, use "subscribe_scan" instead. The scan topic is still subscribed.[0m
[0m[ INFO] [1475488947.098285114]: rtabmap: frame_id = base_link[0m
[0m[ INFO] [1475488947.098684538]: rtabmap: map_frame_id = map[0m
[0m[ INFO] [1475488947.099312711]: rtabmap: queue_size = 30[0m
[0m[ INFO] [1475488947.099829842]: rtabmap: tf_delay = 0.050000[0m
[0m[ INFO] [1475488947.100080778]: rtabmap: tf_tolerance = 0.100000[0m
[0m[ INFO] [1475488947.100675617]: rtabmap: depth_cameras = 1[0m
[0m[ INFO] [1475488947.102409615]: rtabmap: approx_sync = true[0m
[0m[ INFO] [1475488948.917037799]: Setting RTAB-Map parameter "Icp/CorrespondenceRatio"="0.2"[0m
[0m[ INFO] [1475488949.517276671]: Setting RTAB-Map parameter "Kp/MaxDepth"="4.0"[0m
[0m[ INFO] [1475488950.712198413]: Setting RTAB-Map parameter "Mem/RehearsalSimilarity"="0.30"[0m
[0m[ INFO] [1475488952.601634207]: Setting RTAB-Map parameter "RGBD/AngularUpdate"="0.01"[0m
[0m[ INFO] [1475488952.682163139]: Setting RTAB-Map parameter "RGBD/LinearUpdate"="0.01"[0m
[0m[ INFO] [1475488952.819007069]: Setting RTAB-Map parameter "RGBD/NeighborLinkRefining"="true"[0m
[0m[ INFO] [1475488952.867677228]: Setting RTAB-Map parameter "RGBD/OptimizeFromGraphEnd"="true"[0m
[0m[ INFO] [1475488953.023971795]: Setting RTAB-Map parameter "RGBD/ProximityBySpace"="true"[0m
[0m[ INFO] [1475488953.172022360]: Setting RTAB-Map parameter "Reg/Strategy"="2"[0m
[0m[ INFO] [1475488953.231443897]: Setting RTAB-Map parameter "Rtabmap/DetectionRate"="1"[0m
[0m[ INFO] [1475488953.572748650]: Setting RTAB-Map parameter "Rtabmap/TimeThr"="0"[0m
[0m[ INFO] [1475488955.589187135]: Setting RTAB-Map parameter "Vis/InlierDistance"="0.1"[0m
[0m[ INFO] [1475488955.792161405]: Setting RTAB-Map parameter "Vis/MinInliers"="5"[0m
[0m[ INFO] [1475488960.719830749]: RTAB-Map detection rate = 1.000000 Hz[0m
[0m[ INFO] [1475488960.720717409]: rtabmap: Deleted database "/home/pi/.ros/rtabmap.db" (--delete_db_on_start is set).[0m
[0m[ INFO] [1475488960.721020167]: rtabmap: Using database from "/home/pi/.ros/rtabmap.db".[0m
[0m[ INFO] [1475488962.107439887]: rtabmap: Database version = "0.11.8".[0m
[0m[ INFO] [1475488964.159937866]:
/rtabmap/rtabmap subscribed to:
/rtabmap/camera/rgb/image_rect_color,
/rtabmap/camera/depth_registered/image_raw,
/rtabmap/camera/depth_registered/camera_info,
/rtabmap/odometry/synchronized,
/scan[0m
[0m[ INFO] [1475488964.161397178]: rtabmap 0.11.8 started...[0m
[31m[FATAL] (2016-10-03 12:02:52.191) Memory.cpp:1101::getNeighborsIdRadius() Condition (!referential.isNull()) not met![0m

KevinO
10-04-2016, 12:51 AM
It appears that error you were seeing is directly tied with the cob_extern (not really with the phidgets lib), which is for the "Care-O-Bot" product. My stack doesn't call for that. Are you cherry picking stuff from different robot stacks and trying things out?
There is nothing wrong with experimenting with them of course. :) If you are new to ROS it just adds another layer to the learning curve.

As far as the getNeighborsIdRadius() fatal error I'd recommend going to RTABmap GitHub and seeing what that function has in it for clues.


edit:
I cleared out phidgets_drivers and rebuilt it and everything seems fine. The download and compile worked without issue. So it appears it is an issue using cob_extern and it having unmet dependencies.

SnowHead
10-04-2016, 04:07 AM
As source for the libphidgets I gullible used the link from the ROS-Wiki (http://wiki.ros.org/libphidgets) with no suspicion that this repository isn't suitable for the hexabot.
And yes, I'm new to ROS and learned to hate it. Rare and inapplicable documentations, nonfuncional HowTos, the linux-typical affectation from the high horse "eww, but this you had to knew before, that's why there is no explanation for that" and the inavoidable muddle with incompatible versions.
Sorry for that plaint but after weeks of been kidded I'm slightly frustrated at the moment. But I'll push myself to enlive the robot with (or better in spite of using) ROS.

But BTT. I'll look for the reason of the exception when the Raspi will be connected with the robot. May be that the missing servo responses are the reason for the zero calculation exception.

Could you give me some hints for defining the dimensions and angles of the links, joints and frames for the camera as asked by me a few postings before, please?

KevinO
10-04-2016, 09:02 AM
If you are referring to my lack of documentation. I do this as a simple hobby and I provide my code as a base for anyone since there is very little hexapod related stuff in ROS. I'm not paid to do any of this. :)



Could you give me some hints for defining the dimensions and angles of the links, joints and frames for the camera as asked by me a few postings before, please?

Sure. If you are referring to the xacro file. There is already a phantomX xacro tested by a few people. Here is the link to it.

https://github.com/KevinOchs/hexapod_ros/blob/master/hexapod_description/urdf/phantomX_model.xacro

In regards to the camera. A primesense sensor has two cameras in it used for depth. One IR and one Color. Any package that consumes those video streams needs to know the distance from each other camera and any other possible points of articulation (like pan and tilt). In the case of the xacro file there is a pan and tilt servo setup. This allows the point cloud data to be positioned correctly regardless of where the head is looking. The leg joints are pretty straight forward. Joints are measured from axis to axis of each joint in a straight line. They are in millimeters. So sadly the xacro file is only used for navigation and visualization in Rviz. There is a second file used as well since not everyone will need or use rviz. Here is the link for that one.

https://github.com/KevinOchs/hexapod_ros/blob/master/hexapod_description/params/phantomX.yaml

This one is used by all of the IK systems and also includes general configurations. All should work out of the box. Both have been tested by a few people. Although I don't own a phantomX myself. :P



Cheers,
Kevin

SnowHead
10-05-2016, 01:28 AM
Sorry for the late reply. I could pick my robot from the post office yesterday and was fully occupied assembling it, of course. Finished it at 2 AM.

My nagging above was not relating to you. I've a high respect for the work you do in and beside your job. I meant the careless documentations and incompatibilities in linux generally and in ROS specially. If there was the misimpression that I want to criticise your work and answers here then I want to apologize for this misunderstanding. It's not easy to phrase clearly in a foreign language.

I studied the robot description files in your repository long time before I ordered the robot. I had and have the ambition to understand the source for the values I found there and took measurements in the Step-File of the robot. Reading the tutorials about urdf and xacro files in the wiki I unterstood the reason for the values for the links and joints of the legs.
But searching for the reason of the values for the pan- and tilt-parts and the camera frames I gave up. I investigated the available pictures of Charlotte to evaluate the data for distances and angles in the xacro-files but found no relation.
Because my camera is mounted in a different way than on Charlotte (if all servos are centered my camera looks forward and not upward) I have to adapt these values. But without knowing the way of generation of the given values I'll have no chance to do this in the right way.

KevinO
10-06-2016, 10:39 PM
Because my camera is mounted in a different way than on Charlotte (if all servos are centered my camera looks forward and not upward) I have to adapt these values. But without knowing the way of generation of the given values I'll have no chance to do this in the right way.

Charlotte never had ROS on it that was my own code base. Renee's phantomX was one of the test cases. Are you aiming your joint with the Z axis? Cameras in ROS are Z positive in frame. Unlike other joints where X is forward and Z is up.

SnowHead
10-07-2016, 04:35 PM
OK, then it's no wonder that there are no relations between the values in the PhantomX-files and Charlotte.
Then I hope that Renee can give me some hints how to modify the configuration files according to my camera mount. I attached a picture to show, how I made the mount.
By the way, the F2- and F3-Brackets and servo hubs I printed myself with black PETG because the brackets and hubs coming with the servos have an ugly grey color.
I also designed and printed a mount for the camera to be attached to the F2-bracket. If there is an interest I can publish this mount on thingiverse.

6706

r3n33
10-08-2016, 09:54 AM
I'm heading out of town so I won't be able to help much. If you don't understand how the URDF / xacro file are assembled I recommend following the tutorials.

http://wiki.ros.org/urdf_tutorial

in particular you must learn about changing the origins and axis of the joints. See

http://wiki.ros.org/urdf/Tutorials/Building%20a%20Visual%20Robot%20Model%20with%20URD F%20from%20Scratch
and
https://github.com/KevinOchs/hexapod_ros/blob/master/hexapod_description/urdf/phantomX_model.xacro#L64

SnowHead
10-10-2016, 10:09 AM
Thanks for the hints. The posted links I already studied as written earlier.
The essential clarification especially for the uncomprehensible rotation of the optical frames of Pi/2 around the x-axis came from KevinO explaining that the coordinate system of the optical frames is flipped against the mechanical frames. And that Charlotte is not the source for the default values in the description files explains the discrepances between the awaited and the found values.
So I'm confident to be able to write the correct configuration files for my camera mount.