I am using the bridge and all of my messages are correctly mapped except for 1 where I had to change the name from the ros1 version of the message (ros2 does not allow capital letters).
Here is the ros2 version
float32 velocity
float32 current
uint8 command_flag
float32 r_jnt
Here is the ros1 version
float32 velocity
float32 current
uint8 commandFlag
float32 R_jnt
Here is my yaml file
-
ros1_package_name: 'edo_core_msgs'
ros1_msg_name: 'JointState'
ros2_package_name: 'edo_core_msgs'
ros2_msg_name: 'JointState'
fields_1_to_2:
R_jnt: 'r_jnt'
commandFlag: 'command_flag'
current: 'current'
position: 'position'
velocity: 'velocity'
Here is the CMakeLists.txt (only the related part)
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
${srv_files}
)
install(
FILES mapping.yaml
DESTINATION share/${PROJECT_NAME})
ament_export_dependencies(rosidl_default_runtime)
ament_package()
Package.xml
<export>
<ros1_bridge mapping_rules="mapping.yaml"/>
<build_type>ament_cmake</build_type>
</export>
My file structure looks like this
.
├─ ros1_msgs_ws
│ └─ src
│ └─ bridge_msgs
│ └─ msg
│ └─ JointCommand.msg
├─ ros2_msgs_ws
│ └─ src
│ └─ bridge_msgs
│ ├─ msg
│ │ └─ JointCommand.msg
│ └─ # YAML file if your custom interfaces have non-matching names
└─ bridge_ws
└─ src
└─ ros1_bridge
I am using Eloquent built from debian and am bridging to melodic. Im using ubuntu 18.04. Ive followed all the instructions for building very closely and have reproduced the error on mulptiple computers. The bridge builds and includes all my messages except this one. I am now trying to build eloquent from source.
One last thing tht may be related or not. I get error messages when I build the bridge in the format of this:
CMake Warning at /opt/ros/eloquent/share/actionlib_msgs/cmake/actionlib_msgsConfig.cmake:29 (message):
Package 'actionlib_msgs' is deprecated (This package will be removed in a
future ROS distro, once the ROS 1 bridge supports actions.)
Call Stack (most recent call first):
CMakeLists.txt:106 (find_package)
CMake Warning at CMakeLists.txt:186 (add_library):
Cannot generate a safe runtime search path for target ros1_bridge because
files in some directories may conflict with libraries in implicit
directories:
runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Originally posted by maclo4 on ROS Answers with karma: 26 on 2020-11-06
Post score: 0
Original comments
Comment by miura on 2020-11-06:
I don't know if this is related, but position
seems to be present in yaml, but not in msg.
Comment by maclo4 on 2020-11-06:
Scared me for a sec but that’s just a typo. Position is in the message