Progamation problem raspeberry + apm

The 183 fix in in the develop branch of the repository, by the way: GitHub - bluerobotics/bluerov-ros-pkg at develop

Hey Josh thank you for fixing the previous error I had on the Raspberry Pi when install the Bluerov package rebuild. Since I had got the Bluerov package rebuild on the when Raspberry Pi I went on to doing the same on the workstation laptop but when running catkin_make it gave me the error below.

[ 69%] Built target bluerov_generate_messages_py
[ 76%] Built target controller
[ 84%] Building CXX object bluerov/CMakeFiles/pilot.dir/src/pilot.cpp.o
[ 92%] Building CXX object bluerov/CMakeFiles/simple_pilot.dir/src/simple_pilot.cpp.o
/home/viki/catkin_ws/src/bluerov/src/pilot.cpp:10:36: fatal error: mavros/ActuatorControl.h: No such file or directory
#include <mavros/ActuatorControl.h>
^
compilation terminated.
/home/viki/catkin_ws/src/bluerov/src/simple_pilot.cpp:10:32: fatal error: mavros/CommandLong.h: No such file or directory
#include <mavros/CommandLong.h>
^
compilation terminated.
make[2]: *** [bluerov/CMakeFiles/pilot.dir/src/pilot.cpp.o] Error 1
make[1]: *** [bluerov/CMakeFiles/pilot.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
make[2]: *** [bluerov/CMakeFiles/simple_pilot.dir/src/simple_pilot.cpp.o] Error 1
make[1]: *** [bluerov/CMakeFiles/simple_pilot.dir/all] Error 2
make: *** [all] Error 2
Invoking “make” failed
viki@c3po:~/catkin_ws$

Hey Sebastian,

My guess is that you don’t have mavros installed. Have you completed BlueROV ROS Package Installation in the setup documentation?

If you have your path set correctly (the setup documentation does help you set this up) then you should be able to do roscd mavros. That is a good check to see if mavros installed correctly.

Josh

Thank Josh
Simply edit the line 79 in the file simple_pilot.cpp and I could finish the installation.

I can continue.

Hi Josh

When I run the “roscd mavros” command in the terminal of the VM it takes me to the directory "/opt/ros/indigo/share/mavros " this indicates that mavros is installed properly right ? Yet when I run the catkin_make command in the ~/catkin_ws/ directory it gives me the previous error.

[ 69%] Built target bluerov_generate_messages_py
[ 76%] Built target controller
[ 84%] Building CXX object bluerov/CMakeFiles/pilot.dir/src/pilot.cpp.o
[ 92%] Building CXX object bluerov/CMakeFiles/simple_pilot.dir/src/simple_pilot.cpp.o
/home/viki/catkin_ws/src/bluerov/src/pilot.cpp:10:36: fatal error: mavros/ActuatorControl.h: No such file or directory
#include <mavros/ActuatorControl.h>
^
compilation terminated.
/home/viki/catkin_ws/src/bluerov/src/simple_pilot.cpp:10:32: fatal error: mavros/CommandLong.h: No such file or directory
#include <mavros/CommandLong.h>
^
compilation terminated.
make[2]: *** [bluerov/CMakeFiles/pilot.dir/src/pilot.cpp.o] Error 1
make[1]: *** [bluerov/CMakeFiles/pilot.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
make[2]: *** [bluerov/CMakeFiles/simple_pilot.dir/src/simple_pilot.cpp.o] Error 1
make[1]: *** [bluerov/CMakeFiles/simple_pilot.dir/all] Error 2
make: *** [all] Error 2
Invoking “make” failed

Also Thanks for your time and help it is really appreciated.

Yes. This leads me to believe that you have mavros installed correctly. My next thoughts ideas are a dependency problem in the bluerov CMakes file or possibly a PATH probably, although the second one seems less likely.

Unfortunately I don’t have any further suggestions for you at the moment. It is hard for me to assist you here since I cannot recreate the problem locally.

i think the problem is the update of mavros put the files as ActuatorControl.h and CommandLong.h and others to mavros folder to mavros_msg

 

 

I was able to correct the problems of changing commanflong

editing simple_pilot.cpp

line 10
#include <mavros / CommandLong.h>
by
#include <mavros_msgs / CommandLong.h>

line 46
command_client = nh.serviceClient <mavros_msgs :: CommandLong> (“mavros / / cmd / command”);

line 78
mavros_msgs :: CommandLong srv;

but I stuck fixing actuator and Actuator Control

fortunately had a copy of virtual machine with the operating facility so I could move, I’ve only encountered this problem to start the ROV mavlink
ubuntu@bluerov:~$ roslaunch bluerov apm.launch
… logging to /home/ubuntu/.ros/log/6be7b988-6942-11e5-98b0-b827eb10ce6d/roslaunch-bluerov-2589.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://bluerov:38774/

SUMMARY

CLEAR PARAMETERS

  • /mavros/

PARAMETERS

  • /mavros/cmd/use_comp_id_system_control: True
  • /mavros/conn/heartbeat: 5.0
  • /mavros/conn/system_time: 0.0
  • /mavros/conn/timeout: 10.0
  • /mavros/conn/timesync: 0.0
  • /mavros/fcu_url: /dev/ttyACM0:115200
  • /mavros/gcs_url:
  • /mavros/global_position/child_frame_id: fcu
  • /mavros/global_position/frame_id: local_origin
  • /mavros/global_position/rot_covariance: 99999.0
  • /mavros/global_position/send_tf: False
  • /mavros/gps/frame_id: gps
  • /mavros/image/frame_id: px4flow
  • /mavros/imu/angular_velocity_stdev: 0.000349065850399
  • /mavros/imu/frame_id: fcu
  • /mavros/imu/linear_acceleration_stdev: 0.0003
  • /mavros/imu/magnetic_stdev: 0.0
  • /mavros/imu/orientation_stdev: 1.0
  • /mavros/local_position/child_frame_id: fcu
  • /mavros/local_position/frame_id: local_origin
  • /mavros/local_position/send_tf: False
  • /mavros/mission/pull_after_gcs: True
  • /mavros/mocap/use_pose: True
  • /mavros/mocap/use_tf: False
  • /mavros/plugin_blacklist: [‘ftp’, ‘gps’, 'l…
  • /mavros/plugin_whitelist:
  • /mavros/px4flow/frame_id: px4flow
  • /mavros/px4flow/ranger_fov: 0.0
  • /mavros/px4flow/ranger_max_range: 5.0
  • /mavros/px4flow/ranger_min_range: 0.3
  • /mavros/safety_area/p1/x: 1.0
  • /mavros/safety_area/p1/y: 1.0
  • /mavros/safety_area/p1/z: 1.0
  • /mavros/safety_area/p2/x: -1.0
  • /mavros/safety_area/p2/y: -1.0
  • /mavros/safety_area/p2/z: -1.0
  • /mavros/setpoint_accel/send_force: False
  • /mavros/setpoint_attitude/child_frame_id: attitude
  • /mavros/setpoint_attitude/frame_id: local_origin
  • /mavros/setpoint_attitude/listen_tf: False
  • /mavros/setpoint_attitude/listen_twist: False
  • /mavros/setpoint_attitude/pose_with_covariance: False
  • /mavros/setpoint_attitude/reverse_throttle: False
  • /mavros/setpoint_attitude/tf_rate_limit: 10.0
  • /mavros/setpoint_position/child_frame_id: setpoint
  • /mavros/setpoint_position/frame_id: local_origin
  • /mavros/setpoint_position/listen_tf: False
  • /mavros/setpoint_position/tf_rate_limit: 50.0
  • /mavros/startup_px4_usb_quirk: False
  • /mavros/sys/disable_diag: False
  • /mavros/sys/min_voltage: 10.0
  • /mavros/target_component_id: 1
  • /mavros/target_system_id: 1
  • /mavros/tdr_radio/low_rssi: 40
  • /mavros/time/time_ref_source: fcu
  • /mavros/time/timesync_avg_alpha: 0.6
  • /mavros/vision_pose/child_frame_id: vision
  • /mavros/vision_pose/frame_id: local_origin
  • /mavros/vision_pose/listen_tf: False
  • /mavros/vision_pose/pose_with_covariance: False
  • /mavros/vision_pose/tf_rate_limit: 10.0
  • /mavros/vision_speed/listen_twist: False
  • /mavros/visualization/child_frame_id: fcu
  • /mavros/visualization/fixed_frame_id: local_origin
  • /mavros/visualization/marker_scale: 2.0
  • /rosdistro: indigo
  • /rosversion: 1.11.13

NODES
/
mavros (mavros/mavros_node)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[mavros-1]: started with pid [2608]
[ INFO] [1443818011.867345959]: FCU URL: /dev/ttyACM0:115200
[ INFO] [1443818011.869589344]: serial0: device: /dev/ttyACM0 @ 115200 bps
[FATAL] [1443818011.871105490]: FCU: DeviceError:serial:open: No such file or directory
================================================================================REQUIRED process [mavros-1] has died!
process has finished cleanly
log file: /home/ubuntu/.ros/log/6be7b988-6942-11e5-98b0-b827eb10ce6d/mavros-1*.log
Initiating shutdown!

[mavros-1] killing on exit
shutting down processing monitor…
… shutting down processing monitor complete
done
ubuntu@bluerov:~$

it seems that this is a problem with the serial port comuniación

then I put a photo

 


To add, just trying to install bluerov ros package, with mavros and mavros_extras already in and built. There is no ActuatorControl.h anywhere in mavros… wierd.

Any suggestions?

Ah, found it, it’s in plugins…and named actuator_control.cpp … no header file…this is strange…

Jim,

It sounds like there may have been some changes to mavros since we originally wrote our instructions. We’ll take a look into it.

-Rusty

so its ActuatorControl.msg…in mavros_msgs…ok…

if it’s auto gen from the msg file, this makes sense. i suspect there is a version difference between rosinstall_generator for RosberryPI versus the statndard ros-indigo-mavros install. I’m on a Rpi b+ no 2 so I think I have to go through the RosberryPi ROS install nonesense…i’ll update once I solve this issue tonight.

Hi Rusty, yep, suspect as much as well. I’ll work the issue tonight. If I get a solution, I’ll let you know. I’ve forked the repo so if its a good fix we can chat about it and I’ll put in a pull request.

Jim,

Great. Thanks for looking into it and feel free to make a pull request if you have a solution.

Best,

Rusty

Enthusiasts,

Think I fixed it. modified simple_pilot and pilot.cpp for mavros_msgs scope changes in mavros. Created the pull request in git, so hope this does it. Compiles fine on my end. Code has not been tested with full hardware suite, still building my kit, so may need additional changes. Also plan on a different set up so my branch will become different from master in the next week or so.

Regards

Thanks Jim N.

line65 in simple_pilot.cpp
srv.request.command = 183;

I tried and work, Thanks

Now my problems is the comunication APM-Raspberry related in this post

https://discuss.bluerobotics.com/t/error-serial-conexion-with-apm-mavlink/

 

Actually, the line srv.request.command = mavros_msgs::CommandCode::CMD_DO_SET_SERVO is saying = 183; CMD_DO_SET_SERVO is part of a set of constants (should be enums…) that are used in mavros. Its good programming practice to use constants and enums rather than hardcoded numbers. makes for difficult code to maintain with hardcoded numbers laying about and little way in proper structure.

i actually plan on doing some refactoring and clean up in my fork of the repo, so may make it into devel and master in the future :slight_smile: