Present_position from read_write_node to ros2_ws

Hi everyone,

Situation

Ubuntu 22.04 Ros2 Humble

U2D2

DynamixelSDK

Axe 3 et Axe 4 XC 430W240T

Gripper XL430-W250T

Robotic arm

i builded a robotic arm with 5 DOF.

arm_5DOF

there are DC motor for the axis 0, axis1, axis 2 and dynamixel servos XC 430W240T for axis 3 ans axis 4.

i use the SetPosition.msg modified for my servos.

Messages

uint8 id_3

int32 position_3

uint8 id_4

int32 position_4

uint8 id_6

int32 position_6

the code is there

everything is fine.

the last step is to use a urdf model for remote control.

hence the following question :

is there a way to use , the parameter present_position ( in my case present_position_3 and present_position_4) in ros2_ws from read_write_node() code ?

i would like for example publish present_position_3 and present_position_4 on a topic.

does anyone have an idea ?

thank you in advance

Information on how to create publishers within your C++ code is available from the ROS2 online documentation.

I don’t know how to integrate a publisher in the read_write_node code.