I’m getting this error after updating test_unit4.cpp lines 214-225 match the solution:
user:~/ros2_ws/build/behaviortree_ros2$ ./test_unit4
terminate called after throwing an instance of ‘BT::RuntimeError’
what(): Error parsing the XML: XML_ERROR_EMPTY_DOCUMENT
Aborted (core dumped)
I’m receiving this error in the “ROS2 Simulation” section (after exercise 4) in Unit 4 of Behavior Trees. I updated ~/ros2_ws/src/bt_course_files/behaviortree_ros2/test/test_unit4.cpp with the solution code in lines 214-225:
Hmm, did you recompile after making the changes? You would need to recompile for the changes to work. Otherwise, the test_unit4 file would be the compiled version of test_unit4.cpp without the XML file.
I see. I still think test_unit4.cpp is not being rebuilt. It looks like it’s not in the package you are overriding. You can verify that the timestamp of test_unit4 in the build directory changes when you rebuild.
As a last resort, can you try removing build and install and rebuilding everything again?
cd ~/ros2_ws
rm -rf build/ install/ log/
colcon build
....