Closed orjano-max closed 1 year ago
--- stderr: husky_base
In file included from /home/husky/galhusky_ws/src/husky/husky_base/src/husky_hardware.cpp:32:
/home/husky/galhusky_ws/src/husky/husky_base/include/husky_base/husky_hardware.hpp:32:23: error: ‘CallbackReturn’ in namespace ‘hardware_interface’ does not name a type
32 | hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo & info) override;
| ^~~~~~~~~~~~~~
/home/husky/galhusky_ws/src/husky/husky_base/include/husky_base/husky_hardware.hpp:41:23: error: ‘CallbackReturn’ in namespace ‘hardware_interface’ does not name a type
41 | hardware_interface::CallbackReturn on_activate(const rclcpp_lifecycle::State & previous_state) override;
| ^~~~~~~~~~~~~~
/home/husky/galhusky_ws/src/husky/husky_base/include/husky_base/husky_hardware.hpp:44:23: error: ‘CallbackReturn’ in namespace ‘hardware_interface’ does not name a type
44 | hardware_interface::CallbackReturn on_deactivate(const rclcpp_lifecycle::State & previous_state) override;
| ^~~~~~~~~~~~~~
/home/husky/galhusky_ws/src/husky/husky_base/src/husky_hardware.cpp:194:21: error: ‘CallbackReturn’ in namespace ‘hardware_interface’ does not name a type
194 | hardware_interface::CallbackReturn HuskyHardware::on_init(const hardware_interface::HardwareInfo & info)
| ^~~~~~~~~~~~~~
/home/husky/galhusky_ws/src/husky/husky_base/src/husky_hardware.cpp:313:21: error: ‘CallbackReturn’ in namespace ‘hardware_interface’ does not name a type
313 | hardware_interface::CallbackReturn HuskyHardware::on_activate(const rclcpp_lifecycle::State & /*previous_state*/)
| ^~~~~~~~~~~~~~
/home/husky/galhusky_ws/src/husky/husky_base/src/husky_hardware.cpp:332:21: error: ‘CallbackReturn’ in namespace ‘hardware_interface’ does not name a type
332 | hardware_interface::CallbackReturn HuskyHardware::on_deactivate(const rclcpp_lifecycle::State & /*previous_state*/)
| ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/husky_hardware.dir/build.make:63: CMakeFiles/husky_hardware.dir/src/husky_hardware.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/husky_hardware.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< husky_base [18.3s, exited with code 2]
Compilet can't seem to find CallBackReturn in the namespace defined in the code. This therefore has to be changed to the standard call. From
hardware_interface::CallbackReturn
To
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
This change has to be done in two files:
line 32, 41 and 44 in the file: _husky/husky_base/include/husky_base/huskyhardware.hpp
and line 194 313 and 332 in the file: _husky/husky_base/src/huskyhardware.cpp
The return values of the functions using CallBackReturn also has to be rewritten. For example: Line 196 in _husky/husky_base/src/huskyhardware.cpp is rewritten from:
if (hardware_interface::SystemInterface::on_init(info) != hardware_interface::CallbackReturn::SUCCESS)
to
if (hardware_interface::SystemInterface::on_init(info) != rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS)
This applies to line 196, 198, 231, 240, 249, 259, 268, 272, 329 and 336 in _husky/husky_base/src/huskyhardware.cpp. Some lines call for "hardware_interface::CallbackReturn::SUCCESS" as above and some call for "hardware_interface::CallbackReturn::ERROR".
The launch file used to launch the husky in ROS2 Foxy and all attached sensors. Does not work for the galactic packages as well. This is due to changes in files in the ROS2 packages from Foxy to Galactic, specifically, the launch files.
The solution is to make a new launch file based on the husky_base launch file provided in the source code from clearpath. The differences can be seen by comparing the file _code/src/huskygroup/launch/husky1.launch.py from the main branch(Foxy) to the galactic branch in this repo.
The husky did not respond to controller input.
In ROS2 Foxy, the launch file for husky_base launches the husky controllers as well as joy teleop nodes.
This is not the case for the husky_base launch file in ROS2 Galactic. Additionally, the way the controller and keyboard interacts with the husky is completely different in galactic, as the Galactic debian library is missing a package called interactive_marker_twist_server
for ARM CPU's. interactive_marker_twist_server
is therefore added to this repo and built from source along with the other packages.
Adding the interactive_marker_twist_server
package, allowed me to use similar teleop configuration for joy teleop and teleop base as in foxy. These nodes are added to the launch description in the _code/src/huskygroup/launch/husky1.launch.py file.
Husky jerking around in odom
frame.
This happens since both the ekf_node
and the husky_velocity_controller
is publishing odom
tf.
Set a parameter for the husky velocity controller configuration file "control.yaml" to false:
enable_odom_tf: false
Now, only the ekf_node
publishes this transform.
Pose estimation not "yawing" robot when "yawing" it in real life
Apparently, imu_link
is not placed at base_link
anymore. But it can be set by environment variables.
Added the following lines to line 12 in the file code/src/husky_group/launch/husky1.launch.py:
os.environ["HUSKY_IMU_XYZ"] = "0 0 0"
os.environ["HUSKY_IMU_RPY"] = "0 0 0"
Even though the Nav2 packages was installed through debian, they were not able to launch when passing our parameter files into the launch argument.
The parameter files for Nav2 Foxy and Nav2 Galactic have differences. Updated parameter files for Galactic were therefore made. This was then done for all packages where we pass our own parameter files. to prevent future bugs caused by parameter incompatibility
Issues When Porting Husky to Galactic
The porting to ros2 galactic had some issues.mainly, the issues were: