Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run zenoh under aic container #150

Merged
merged 66 commits into from
Oct 18, 2024
Merged

Conversation

knorrrr
Copy link
Contributor

@knorrrr knorrrr commented Oct 17, 2024

・AIチャレンジコンテナ下でZenohを起動するようにしました。

私の環境ではPC2台でAutowareのトピックをros2 topic echoできました。
一応実行確認お願いします。

yusuke-y819 and others added 30 commits September 27, 2024 14:33
* Revert "remove debug"

This reverts commit 1d10963.

* add multi_data_monitor

* add multi_data_monitor depends

* add multidatamonitor(accel brake steer)

* update rviz

* update readme

* add control_cmd
* save

* feat: add section and lap timer for debug

* feat: add section and lap timer
* add mps

* set colors properly

* add mpc pid multidatamonitor

* chore add mpc

* add measured

* update rviz

* add mpc plotjuggler

* fix plotjuggler config

* add localizer plotjuggler

* multidata monitor add deg rad conversion

* update plotjuggler localizer(yaw)

* multidatamonitor reduce digits

* chore digits multidatamonitor
* frame_id変換のためのノード追加

* fix: pose_cov_transformer.cpp

pose_positionの計算の修正を行いました

---------

Co-authored-by: Tom Sawada <160597893+Tom-Sawada705@users.noreply.github.com>
* wip

* feat

* feat

* wip

* wip

* wip

* Delete aichallenge/result-details.json

* fix: run_simulator.bash

パスについて、AWSIM_GPUからAWSIMに戻しました

---------

Co-authored-by: knorrrr <99851410+knorrrr@users.noreply.github.com>
Co-authored-by: Tom Sawada <160597893+Tom-Sawada705@users.noreply.github.com>
fix(pose_cov_node): fix culculation
* fix:Dockerfile

* fix:Dockerfile2

* fix: Dockerfile

---------

Co-authored-by: toki-1441 <abc@example.com>
* fix:Dockerfile

* fix:Dockerfile2

* fix: Dockerfile

* fix:reference.launch.xml

---------

Co-authored-by: toki-1441 <abc@example.com>
* cp reference

* cp reference

* separate rosbag and simreal

* launch branch is_rosbag

* add rosbag and launch script

* fix launch args(effects pose timestamp, resulting ekf error)

* path chagne

* add separate rosbag

* add separate rosbag

* update localizer plotjuggler

* plotjuggler add linear vel

* update lozalizer pltjuggler

* del unnecessary launch(planning)

* diable planning when is_rosbag
* feat: add true gps module and edit reference launch

* Update aichallenge/workspace/src/aichallenge_submit/gps_module/src/true_gps_module.cpp

---------

Co-authored-by: knorrrr <99851410+knorrrr@users.noreply.github.com>
* publish gnss pose

* update plotjuggler

* update plt

* update plotjuggler

* add comment out

* update plotjuggler

* chore change rosbag filename
@taikitanaka3
Copy link
Contributor

@knorrrr
とりあえず、run_zenoh.shしてみたんですが、zenoh用の設定がなにか必要ですかね?

docker run --rm -it --device /dev/dri  -e ROS_DISTRO=humble --name zenoh  --network host  --privileged -v /home/t4tanaka/aichallenge-2024/vehicle/aichallenge:/aichallenge  -e DISPLAY -e TERM   -e QT_X11_NO_MITSHM=1   -e XAUTHORITY=/tmp/.docker3lqxqj1_.xauth -v /tmp/.docker3lqxqj1_.xauth:/tmp/.docker3lqxqj1_.xauth   -v /tmp/.X11-unix:/tmp/.X11-unix   -v /etc/localtime:/etc/localtime:ro  6ed82126add9 zenoh-bridge-ros2dds -c /vehicle/zenoh.json5
2024-10-17T12:50:39.692930Z  INFO main ThreadId(01) zenoh_bridge_ros2dds: zenoh-bridge-ros2dds v1.0.0-rc.1
2024-10-17T12:50:39.693796Z  INFO main ThreadId(01) zenoh_bridge_ros2dds: Zenoh Config(Config { id: d195fcf5001efa5f57ad2b8c0ea75beb, metadata: Null, mode: Some(Router), connect: ConnectConfig { timeout_ms: None, endpoints: Unique([]), exit_on_failure: None, retry: None }, listen: ListenConfig { timeout_ms: None, endpoints: Dependent(ModeValues { router: Some([tcp/[::]:7447]), peer: Some([tcp/[::]:0]), client: None }), exit_on_failure: None, retry: None }, scouting: ScoutingConf { timeout: None, delay: None, multicast: ScoutingMulticastConf { enabled: None, address: None, interface: None, ttl: None, autoconnect: None, listen: None }, gossip: GossipConf { enabled: None, multihop: None, autoconnect: None } }, timestamping: TimestampingConf { enabled: Some(Unique(true)), drop_future_timestamp: None }, queries_default_timeout: None, routing: RoutingConf { router: RouterRoutingConf { peers_failover_brokering: None }, peer: PeerRoutingConf { mode: None } }, aggregation: AggregationConf { subscribers: [], publishers: [] }, transport: TransportConf { unicast: TransportUnicastConf { accept_timeout: 10000, accept_pending: 100, max_sessions: 1000, max_links: 1, lowlatency: false, qos: QoSUnicastConf { enabled: true }, compression: CompressionUnicastConf { enabled: false } }, multicast: TransportMulticastConf { join_interval: Some(2500), max_sessions: Some(1000), qos: QoSMulticastConf { enabled: false }, compression: CompressionMulticastConf { enabled: false } }, link: TransportLinkConf { protocols: None, tx: LinkTxConf { sequence_number_resolution: U32, lease: 10000, keep_alive: 4, batch_size: 65535, queue: QueueConf { size: QueueSizeConf { control: 1, real_time: 1, interactive_high: 1, interactive_low: 1, data_high: 2, data: 4, data_low: 2, background: 1 }, congestion_control: CongestionControlConf { drop: CongestionControlDropConf { wait_before_drop: 1000 }, block: CongestionControlBlockConf { wait_before_close: 5000000 } }, batching: BatchingConf { enabled: true, time_limit: 1 } }, threads: 3 }, rx: LinkRxConf { buffer_size: 65535, max_message_size: 1073741824 }, tls: TLSConf { root_ca_certificate: None, listen_private_key: None, listen_certificate: None, enable_mtls: None, connect_private_key: None, connect_certificate: None, verify_name_on_connect: None, root_ca_certificate_base64: None, listen_private_key_base64: None, listen_certificate_base64: None, connect_private_key_base64: None, connect_certificate_base64: None }, unixpipe: UnixPipeConf { file_access_mask: None } }, shared_memory: ShmConf { enabled: true }, auth: AuthConf { usrpwd: UsrPwdConf { user: None, password: None, dictionary_file: None }, pubkey: PubKeyConf { public_key_pem: None, private_key_pem: None, public_key_file: None, private_key_file: None, key_size: None, known_keys_file: None } } }, adminspace: AdminSpaceConf { enabled: true, permissions: PermissionsConf { read: true, write: false } }, downsampling: [], access_control: AclConfig { enabled: false, default_permission: Deny, rules: None, subjects: None, policies: None }, plugins_loading: PluginsLoading { enabled: true, search_dirs: LibSearchDirs([Spec(LibSearchSpec { kind: CurrentExeParent, value: None }), Path("."), Path("~/.zenoh/lib"), Path("/opt/homebrew/lib"), Path("/usr/local/lib"), Path("/usr/lib")]) }, plugins: Object {"ros2dds": Object {"allow": Object {"action_clients": Array [], "action_servers": Array [], "publishers": Array [String(".*")], "service_clients": Array [], "service_servers": Array [], "subscribers": Array [String("/racing_kart/joy"), String("/initialpose")]}, "pub_priorities": Array [String("/racing_kart/joy=1:express")], "queries_timeout": Object {"default": Number(2.0)}, "ros_localhost_only": Bool(false)}} })
2024-10-17T12:50:39.693886Z  INFO main ThreadId(01) zenoh::net::runtime: Using ZID: d195fcf5001efa5f57ad2b8c0ea75beb
2024-10-17T12:50:39.694238Z  INFO main ThreadId(01) zenoh::api::loader: Starting required plugin "ros2dds"
2024-10-17T12:50:39.694614Z  INFO main ThreadId(01) zenoh::api::loader: Successfully started plugin ros2dds from "__static_lib__"
2024-10-17T12:50:39.694621Z  INFO main ThreadId(01) zenoh::api::loader: Finished loading plugins
2024-10-17T12:50:39.694646Z  INFO tokio-runtime-worker ThreadId(06) zenoh_plugin_ros2dds: ROS2 plugin Config { namespace: "/", nodename: "zenoh_bridge_ros2dds", domain: 0, ros_localhost_only: false, allowance: Some(Allow(ROS2InterfacesRegex { publishers: Some(Regex("^.*$")), subscribers: Some(Regex("^/racing_kart/joy$|^/initialpose$")), service_servers: None, service_clients: None, action_servers: None, action_clients: None })), pub_max_frequencies: [], transient_local_cache_multiplier: 10, queries_timeout: Some(QueriesTimeouts { default: 2.0, transient_local_subscribers: [], services: [], actions: None }), reliable_routes_blocking: true, pub_priorities: [(Regex("/racing_kart/joy"), (RealTime, true))], work_thread_num: 2, max_block_thread_num: 50, __required__: None, __path__: None }
2024-10-17T12:50:39.694965Z  INFO                 main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/[2405:6580:b8e0:f00:aa83:75ad:24a9:e59e]:7447
2024-10-17T12:50:39.694981Z  INFO                 main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/[2405:6580:b8e0:f00:c1d1:6d50:1858:702e]:7447
2024-10-17T12:50:39.694985Z  INFO                 main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/[fe80::7ce3:cd03:c4bd:bda6]:7447
2024-10-17T12:50:39.694991Z  INFO                 main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/192.168.151.100:7447
2024-10-17T12:50:39.695087Z  INFO                 main ThreadId(01) zenoh::net::runtime::orchestrator: zenohd listening scout messages on 224.0.0.224:7446
1729169439.696626 [0] tokio-runt: selected interface "lo" is not multicast-capable: disabling multicast
1729169439.696812 [0] tokio-runt: failed to increase socket receive buffer size to at least 10485760 bytes, current is 425984 bytes
thread 'tokio-runtime-worker' panicked at zenoh-plugin-ros2dds/src/lib.rs:355:14:
Failed to create RosDiscoveryInfoMgr: "Error creating DDS Reader on ros_discovery_info: Precondition Not Met"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@knorrrr
Copy link
Contributor Author

knorrrr commented Oct 17, 2024

@taikitanaka3
あれ、なんだろう。
bash docker_build.sh dev cpuは実行されました?

@taikitanaka3
Copy link
Contributor

以下のコマンドで解決できました。ただ、毎回以下を叩いてもらうで良いのかよくわかってないです。

sudo sysctl -w net.core.rmem_max=10485760
sudo sysctl -w net.core.rmem_default=10485760
sudo infconfig lo multicast

@taikitanaka3
Copy link
Contributor

実行はこれですね。

bash docker_build.sh dev 

@knorrrr
Copy link
Contributor Author

knorrrr commented Oct 17, 2024

ここらへんの設定もDockerfile書いちゃっても良さそうですね。

@knorrrr
Copy link
Contributor Author

knorrrr commented Oct 17, 2024

この3つのパラメータはhostとネットワーク共有してるのと、Kernel系の設定なので、Dockerfileには書けないっぽいですね。
#150 (comment)

再現できてないので詳しくはわかりませんが、
Kernel系はホストと共有するはずなので、ホストの方で設定が必要そうです

@taikitanaka3
Copy link
Contributor

taikitanaka3 commented Oct 17, 2024

a80ada8

user accountなので、sudo 権限はなかったと思います。
一旦明日どうしたらいいか考えてみます。

@masahiro-kubota
Copy link
Contributor

@taikitanaka3 @knorrrr
実機ではセットアップの段階で設定しています。
image
INTERNAL LINK

Signed-off-by: Masahiro Kubota <norikenpi@gmail.com>
Signed-off-by: Masahiro Kubota <norikenpi@gmail.com>
@masahiro-kubota
Copy link
Contributor

@knorrrr @taikitanaka3
ホストで設定する必要がある項目は一旦このPRからは削除して、別PRを作ろうと思います

Copy link
Contributor

@masahiro-kubota masahiro-kubota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PC2台で片方をコンテナ内からvehicle/run_zenoh.bashで起動し、もう片方をコンテナ内からzenoh-bridge-ros2dds -e "tcp/192.168.1.10:7447"をしてAutowareのトピックをros2 topic echoすることができましたので、Approveします。

@masahiro-kubota masahiro-kubota merged commit a769e47 into main Oct 18, 2024
@masahiro-kubota masahiro-kubota deleted the feat/aic_zenoh_docker branch October 18, 2024 03:25
@knorrrr
Copy link
Contributor Author

knorrrr commented Oct 18, 2024

了解です!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants