Skip to content

Instantly share code, notes, and snippets.

@3panda
Created May 23, 2020 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3panda/0a3a78990416fa781080167c79df15e1 to your computer and use it in GitHub Desktop.
Save 3panda/0a3a78990416fa781080167c79df15e1 to your computer and use it in GitHub Desktop.

ROS2とUnityの連携を行いたくて、ros2_dotnetを試したのですが、依存関係のあるライブラリのbuildで失敗しているようで成功しませんでした。

その後解決しDockerで実装出来るこちらを用意して下さったので利用出来たのですが、個人的に理解するためにこちらのDockerfileを参考に一つづつコマンドを実行しなおしました。

また私のROS2が今はdashingにしているので一部だけ書き換えてます。

以下の通りやってみおたところ、ros2_dotnetのpublisher-and-subscriberは実行出来ました。

export WORKDIR="$HOME"
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install -y apt-transport-https dotnet-sdk-2.1
mkdir -p $WORKDIR/ros2_dotnet_ws/src
cd $WORKDIR/ros2_dotnet_ws
wget https://raw.githubusercontent.com/ros2-dotnet/ros2_dotnet/master/ros2_dotnet.repos
vcs import src < ros2_dotnet.repos
cd $WORKDIR/ros2_dotnet_ws/src
# ToDo : add git clone lines for the additional message package
cd $WORKDIR/ros2_dotnet_ws
rosdep install -y -r -i --from-paths src --ignore-src --rosdistro dashing
source /opt/ros/dashing/setup.bash && colcon build --event-handlers console_cohesion+ console_package_list+
mkdir $WORKDIR/UnityRclDotnet
# copy files from rcldotnet
cp $WORKDIR/ros2_dotnet_ws/install/rcldotnet/lib/rcldotnet/dotnet/builtin_interfaces_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/rcldotnet/lib/librcldotnet_native.so $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/rcldotnet/lib/librcldotnet_node_native.so $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/rcldotnet/lib/librcldotnet_publisher_native.so $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/rcldotnet/lib/rcldotnet/dotnet/rcldotnet_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/rcldotnet/lib/rcldotnet/dotnet/rcldotnet_common.dll $WORKDIR/UnityRclDotnet
# copy files from std_msgs
cp $WORKDIR/ros2_dotnet_ws/install/std_msgs/lib/std_msgs/dotnet/std_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/std_msgs/lib/libstd_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from actionlib_msgs
cp $WORKDIR/ros2_dotnet_ws/install/actionlib_msgs/lib/actionlib_msgs/dotnet/actionlib_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/actionlib_msgs/lib/libactionlib_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from diagnostic_msgs
cp $WORKDIR/ros2_dotnet_ws/install/diagnostic_msgs/lib/diagnostic_msgs/dotnet/diagnostic_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/diagnostic_msgs/lib/libdiagnostic_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from geometry_msgs
cp $WORKDIR/ros2_dotnet_ws/install/geometry_msgs/lib/geometry_msgs/dotnet/geometry_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/geometry_msgs/lib/libgeometry_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from nav_msgs
cp $WORKDIR/ros2_dotnet_ws/install/nav_msgs/lib/nav_msgs/dotnet/nav_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/nav_msgs/lib/libnav_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from sensor_msgs
cp $WORKDIR/ros2_dotnet_ws/install/sensor_msgs/lib/sensor_msgs/dotnet/sensor_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/sensor_msgs/lib/libsensor_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from shape_msgs
cp $WORKDIR/ros2_dotnet_ws/install/shape_msgs/lib/shape_msgs/dotnet/shape_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/shape_msgs/lib/libshape_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from stereo_msgs
cp $WORKDIR/ros2_dotnet_ws/install/stereo_msgs/lib/stereo_msgs/dotnet/stereo_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/stereo_msgs/lib/libstereo_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from trajectory_msgs
cp $WORKDIR/ros2_dotnet_ws/install/trajectory_msgs/lib/trajectory_msgs/dotnet/trajectory_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/trajectory_msgs/lib/libtrajectory_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from visualization_msgs
cp $WORKDIR/ros2_dotnet_ws/install/visualization_msgs/lib/visualization_msgs/dotnet/visualization_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/visualization_msgs/lib/libvisualization_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
# copy files from unique_identifier_msgs
cp $WORKDIR/ros2_dotnet_ws/install/unique_identifier_msgs/lib/unique_identifier_msgs/dotnet/unique_identifier_msgs_assemblies.dll $WORKDIR/UnityRclDotnet
cp $WORKDIR/ros2_dotnet_ws/install/unique_identifier_msgs/lib/libunique_identifier_msgs__dotnetext_native.so $WORKDIR/UnityRclDotnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment