# Encounter symbol lookup error when transmitting the action result

**URL:** <https://get-help.theconstruct.ai/t/encounter-symbol-lookup-error-when-transmitting-the-action-result/28668>\
**Category:** ROS2 in 5 Days C++\
**Tags:** actions\
**Created:** [January 31, 2024, 9:43am UTC](https://get-help.theconstruct.ai/t/encounter-symbol-lookup-error-when-transmitting-the-action-result/28668 "2024-01-31T09:43:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackychow.yh3](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/jackychow.yh3/32/6967_2.png) [@jackychow.yh3](https://get-help.theconstruct.ai/u/jackychow.yh3)\
**Post date:** [January 31, 2024, 9:43am UTC](https://get-help.theconstruct.ai/t/encounter-symbol-lookup-error-when-transmitting-the-action-result/28668/1 "2024-01-31T09:43:51Z")

</div>

Hello all,

I am not able to send out the action goal result . May I ask you for help to provide some guidance?

@The error I received  
:[record\_odom\_action\_server\_node-1] /home/user/ros2\_ws/install/record\_odom/lib/record\_odom/record\_odom\_action\_server\_node: symbol lookup error: /home/user/ros2\_ws/install/custom\_interfaces/lib/libcustom\_interfaces\_\_rosidl\_typesupport\_fastrtps\_cpp.so: undefined symbol:\_ZN13geometry\_msgs3msg24typesupport\_fastrtps\_cpp19get\_serialized\_sizeERKNS0\_8Point32\_ISaIvEEEm

@action\_msg:

---

geometry\_msgs/Point32[] list\_of\_odoms

---

float32 current\_total

@Reference: [ROSDS - colcon build fails - environment dependency requirement - ROSDS Support - The Construct ROS Community (robotigniteacademy.com)](https://get-help.robotigniteacademy.com/t/rosds-colcon-build-fails-environment-dependency-requirement/19994/7)

@Code of the action server:  
#include “geometry\_msgs/msg/detail/point32\_\_struct.hpp”  
#include “geometry\_msgs/msg/detail/quaternion\_\_struct.hpp”  
#include “geometry\_msgs/msg/point32.hpp”  
#include “rclcpp/rclcpp.hpp”  
#include “rclcpp\_action/rclcpp\_action.hpp”  
#include “functional”  
#include “memory”  
#include “thread”

#include “custom\_interfaces/action/odom\_record.hpp”  
#include “geometry\_msgs/msg/twist.hpp”  
#include “nav\_msgs/msg/odometry.hpp”

class OdomActionServer : public rclcpp::Node {  
public:  
using OdomRecord = custom\_interfaces::action::OdomRecord;  
using GoalHandleOdomRecord = rclcpp\_action::ServerGoalHandle;

//std::vector\<geometry\_msgs::msg::Point32\> list\_of\_odoms;

explicit OdomActionServer(  
const rclcpp::NodeOptions &options = rclcpp::NodeOptions())  
: Node(“record\_odom”, options) {  
using namespace std::placeholders;

```
this->action_server_ = rclcpp_action::create_server<OdomRecord>(
    this, "record_odom_as",
    std::bind(&OdomActionServer::handle_goal, this, _1),
    std::bind(&OdomActionServer::handle_cancel, this, _1),
    std::bind(&OdomActionServer::handle_accepted, this, _1));

publisher_ =
    this->create_publisher<geometry_msgs::msg::Twist>("cmd_vel", 10);

subscription_ = this->create_subscription<nav_msgs::msg::Odometry>(
    "odom", 10, std::bind(&OdomActionServer::odom_callback, this, _1));

```

}

private:  
rclcpp\_action::Server::SharedPtr action\_server\_;  
rclcpp::Publisher\<geometry\_msgs::msg::Twist\>::SharedPtr publisher\_;  
rclcpp::Subscription\<nav\_msgs::msg::Odometry\>::SharedPtr subscription\_;  
geometry\_msgs::msg::Point32 actual\_coords;  
std::vector\<geometry\_msgs::msg::Point32\> odom\_coords;

float DistanceFromStart;  
float distance\_total;  
float distance\_current;

void odom\_callback(const nav\_msgs::msg::Odometry::SharedPtr msg) {

```
// RCLCPP_INFO(this->get_logger(), "Odometry=['%f','%f','%f']",
// msg->pose.pose.position.x, msg->pose.pose.position.y,
// msg->pose.pose.position.z);

this->actual_coords.x = msg->pose.pose.position.x;
this->actual_coords.y = msg->pose.pose.position.y;
this->actual_coords.z = msg->pose.pose.position.z;
// rclcpp::sleep_for(std::chrono::milliseconds(50));

```

}

// How do we make empty goal? Without setting the goal argument  
rclcpp\_action::GoalResponse handle\_goal(const rclcpp\_action::GoalUUID &uuid) {  
RCLCPP\_INFO(this-\>get\_logger(), “Received goal: Record Odometry”);  
(void)uuid;  
// distance\_current = 0.0;  
return rclcpp\_action::GoalResponse::ACCEPT\_AND\_EXECUTE;  
}

rclcpp\_action::CancelResponse  
handle\_cancel(const std::shared\_ptr goal\_handle) {  
RCLCPP\_INFO(this-\>get\_logger(), “Received request to cancel goal”);  
(void)goal\_handle;  
return rclcpp\_action::CancelResponse::ACCEPT;  
}

void  
handle\_accepted(const std::shared\_ptr goal\_handle) {  
using namespace std::placeholders;  
// this needs to return quickly to avoid blocking the executor, so spin up a  
// new thread  
std::thread{std::bind(&OdomActionServer::execute, this, \_1), goal\_handle}  
.detach();  
}

void execute(const std::shared\_ptr goal\_handle) {  
RCLCPP\_INFO(this-\>get\_logger(), “Executing goal”);

```
const auto goal = goal_handle->get_goal();

auto feedback = std::make_shared<OdomRecord::Feedback>();
auto &fb_message = feedback->current_total;
fb_message = 0.0;

auto result = std::make_shared<OdomRecord::Result>();
rclcpp::Rate loop_rate(1);

odom_coords.push_back(actual_coords);
goal_handle->publish_feedback(feedback);

std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    
if (rclcpp::ok()) {
  result->list_of_odoms = odom_coords; ;
  goal_handle->succeed(result);
  RCLCPP_INFO(this->get_logger(), "Goal succeeded");
}

```

}

}; // class OdomActionServer

int main(int argc, char \*\*argv) {  
rclcpp::init(argc, argv);

auto action\_server = std::make\_shared();

rclcpp::executors::MultiThreadedExecutor executor;  
executor.add\_node(action\_server);  
executor.spin();

rclcpp::shutdown();  
return 0;  
}

@Method Tried:  
cd /path/to/your/ros2\_workspace  
rm -r build install  
colcon build --symlink-install

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [January 31, 2024, 10:36am UTC](https://get-help.theconstruct.ai/t/encounter-symbol-lookup-error-when-transmitting-the-action-result/28668/2 "2024-01-31T10:36:22Z")

</div>

Are you taking a ros1 or ros2 course? You posted this under the ROS 1 course.

> [@jackychow.yh3](#):
>
> /home/user/ros2\_ws/install/record\_odom/lib/record\_odom/record\_odom\_action\_server\_node: symbol lookup error:

Check that your action messages are properly setup and built. Carefully go over the steps again, building it from scratch.

Then remove build and install and compile again.

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [February 5, 2024, 10:36am UTC](https://get-help.theconstruct.ai/t/encounter-symbol-lookup-error-when-transmitting-the-action-result/28668/3 "2024-02-05T10:36:44Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
