ethz-asl / rotors_simulator

RotorS is a UAV gazebo simulator
1.26k stars 766 forks source link

hil_interface missing mavlink include (kinetic) #367

Closed jgoppert closed 3 years ago

jgoppert commented 7 years ago
Errors     << rotors_hil_interface:make /home/jgoppert/git/catkin/logs/rotors_hil_interface/build.make.000.log
In file included from /home/jgoppert/git/catkin/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:17:0:
/home/jgoppert/git/catkin/src/rotors_simulator/rotors_hil_interface/include/rotors_hil_interface/hil_interface.h:105:3: error: ‘mavlink_hil_gps_t’ does not name a type

I am working on fixing this. If I include the mavlink common header I get a bit further but get more errors. @gbmhunter have you run into this before?

If I use the indigo-devel branch as specified in rosinstall it works, but it would be good to use the version released with kinetic and get rotors to officially support kinetic.

Current, working workspace in kinetic:

 Localname        S SCM Version (Spec) UID  (Spec)  URI  (Spec) [http(s)://...]
 ---------        - --- -------------- -----------  ---------------------------
 yaml_cpp_catkin    git master  (-)    60313a2c8a1c github.com/ethz-asl/yaml_cpp_catkin.git
 rotors_simulator   git master  (-)    45eaf016e125 github.com/ethz-asl/rotors_simulator.git
 mavros             git indigo-devel   5189e9320db9 github.com/mavlink/mavros.git
 mavlink            git upstream       8c7bc2230c9b github.com/mavlink/mavlink-gbp-release.git
 mav_comm           git master  (-)    83d8b322f019 github.com/ethz-asl/mav_comm.git
 catkin_simple      git master  (-)    0e62848b12da github.com/catkin/catkin_simple.git
gbmhunter commented 7 years ago

@jgoppert I have definitely received this error before, I can't remember exactly when and why though sorry! I remember "grepping" the type name through my entire computer and finding the right include through that.

taylorbodin commented 7 years ago

@jgoppert Please let me know if you figure out what to include to get this to build properly. I am running into the same issues.

Maunsi commented 7 years ago

Hello, has anyone found the solution to this?

msadowski commented 7 years ago

I'm running into the same issue. The hil messages seem to be defined in mavlink generated lib (which doesn't seem to be included in any of the packages specified in the HIL docs).

protobits commented 6 years ago

Any workaround for this? The full error on kinetic is:

[ 20%] Building CXX object CMakeFiles/rotors_hil_interface.dir/src/hil_sensor_level_interface.cpp.o
In file included from /home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:17:0: /home/v01d/ros/src/rotors_simulator/rotors_hil_interface/include/rotors_hil_interface/hil_interface.h:105:3: error: ‘mavlink_hil_gps_t’ does not name a type mavlink_hil_gps_t hil_gpsmsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/include/rotors_hil_interface/hil_interface.h:108:3: error: ‘mavlink_hil_sensor_t’ does not name a type mavlink_hil_sensor_t hil_sensormsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/include/rotors_hil_interface/hil_interface.h:130:3: error: ‘mavlink_hil_state_quaternion_t’ does not name a type mavlink_hil_state_quaternion_t hil_state_qtrnmsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp: In member function ‘virtual std::vector<mavrosmsgs::Mavlink<std::allocator > > rotors_hil::HilSensorLevelInterface::CollectData()’: /home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:89:3: error: ‘mavlink_message_t’ was not declared in this scope mavlink_message_t mmsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:89:3: note: suggested alternatives: In file included from /opt/ros/kinetic/include/mavlink/v2.0/common/../message.hpp:15:0,
from /opt/ros/kinetic/include/mavlink/v2.0/common/common.hpp:16,
from /opt/ros/kinetic/include/mavconn/mavlink_dialect.h:26,
from /opt/ros/kinetic/include/mavros_msgs/mavlink_convert.h:18,
from /home/v01d/ros/src/rotors_simulator/rotors_hil_interface/include/rotors_hil_interface/hil_interface.h:23, from /home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:17: /opt/ros/kinetic/include/mavlink/v2.0/common/../mavlink_types.h:121:4: note: ‘mavlink::mavlink_message_t’ }) mavlink_message_t;
^
/opt/ros/kinetic/include/mavlink/v2.0/common/../mavlink_types.h:121:4: note: ‘mavlink::mavlink_message_t’ /home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:105:5: error: ‘hil_gpsmsg’ was not declared in this scope hil_gpsmsg.time_usec = time_usec;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:119:5: error: ‘mavlink_hil_gps_t’ was not declared in this scope mavlink_hil_gps_t hil_gps_msg_ptr = &hil_gpsmsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:119:24: error: ‘hil_gps_msg_ptr’ was not declared in this scope mavlink_hil_gps_t
hil_gps_msg_ptr = &hil_gpsmsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:120:39: error: ‘mmsg’ was not declared in this scope mavlink_msg_hil_gps_encode(1, 0, &mmsg, hil_gps_msg_ptr);
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:120:60: error: ‘mavlink_msg_hil_gps_encode’ was not declared in this scope mavlink_msg_hil_gps_encode(1, 0, &mmsg, hil_gps_msg_ptr);
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:131:3: error: ‘hil_sensormsg’ was not declared in this scope hil_sensormsg.time_usec = time_usec;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:147:3: error: ‘mavlink_hil_sensor_t’ was not declared in this scope mavlink_hil_sensor_t hil_sensor_msg_ptr = &hil_sensormsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:147:25: error: ‘hil_sensor_msg_ptr’ was not declared in this scope mavlink_hil_sensor_t
hil_sensor_msg_ptr = &hil_sensormsg;
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:148:40: error: ‘mmsg’ was not declared in this scope mavlink_msg_hil_sensor_encode(1, 0, &mmsg, hil_sensor_msg_ptr);
^
/home/v01d/ros/src/rotors_simulator/rotors_hil_interface/src/hil_sensor_level_interface.cpp:148:64: error: ‘mavlink_msg_hil_sensor_encode’ was not declared in this scope mavlink_msg_hil_sensor_encode(1, 0, &mmsg, hil_sensor_msg_ptr);
^
CMakeFiles/rotors_hil_interface.dir/build.make:62: recipe for target 'CMakeFiles/rotors_hil_interface.dir/src/hil_sensor_level_interface.cpp.o' failed make[2]: [CMakeFiles/rotors_hil_interface.dir/src/hil_sensor_level_interface.cpp.o] Error 1
make[1]:
[CMakeFiles/rotors_hil_interface.dir/all] Error 2
CMakeFiles/Makefile2:249: recipe for target 'CMakeFiles/rotors_hil_interface.dir/all' failed
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Failed <<< rotors_hil_interface [ 9.7 seconds ]
[build] Summary: 1 of 2 packages succeeded.
[build] Ignored: 44 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: None.
[build] Failed: 1 packages failed.
[build] Runtime: 11.0 seconds total.

Jaeyoung-Lim commented 3 years ago

This should be fixed now, closing