Add config file

Signed-off-by: Yu Asabe <yuasabe@g.ecc.u-tokyo.ac.jp>
This commit is contained in:
Yu Asabe 2022-11-26 10:17:30 +09:00
parent 56989f5bd9
commit 1fb35c3af5
4 changed files with 8 additions and 2 deletions

View File

@ -59,4 +59,5 @@ endif()
ament_auto_package(INSTALL_TO_SHARE ament_auto_package(INSTALL_TO_SHARE
launch launch
config
) )

View File

@ -0,0 +1,4 @@
/**:
ros__parameters:
network_interface: "wlp4s0"
is_sender: true

View File

@ -2,7 +2,6 @@
<arg name="network_interface" default="wlp5s0"/> <arg name="network_interface" default="wlp5s0"/>
<arg name="is_sender" default="true"/> <arg name="is_sender" default="true"/>
<node pkg="autoware_v2x" exec="autoware_v2x_node" namespace="v2x" output="screen"> <node pkg="autoware_v2x" exec="autoware_v2x_node" namespace="v2x" output="screen">
<param name="network_interface" value="$(var network_interface)"/> <param from="$(find-pkg-share autoware_v2x)/config/autoware_v2x.param.yaml"/>
<param name="is_sender" value="$(var is_sender)"/>
</node> </node>
</launch> </launch>

View File

@ -113,6 +113,7 @@ namespace v2x
sout << mac_address; sout << mac_address;
RCLCPP_INFO(node_->get_logger(), "MAC Address: '%s'", sout.str().c_str()); RCLCPP_INFO(node_->get_logger(), "MAC Address: '%s'", sout.str().c_str());
// Geonetworking Management Infirmation Base (MIB) defines the GN protocol constants.
gn::MIB mib; gn::MIB mib;
mib.itsGnLocalGnAddr.mid(mac_address); mib.itsGnLocalGnAddr.mid(mac_address);
mib.itsGnLocalGnAddr.is_manually_configured(true); mib.itsGnLocalGnAddr.is_manually_configured(true);
@ -120,6 +121,7 @@ namespace v2x
mib.itsGnSecurity = false; mib.itsGnSecurity = false;
mib.itsGnProtocolVersion = 1; mib.itsGnProtocolVersion = 1;
// Create raw socket on device and LinkLayer object
auto link_layer = create_link_layer(io_service, device, "ethernet"); auto link_layer = create_link_layer(io_service, device, "ethernet");
auto positioning = create_position_provider(io_service, trigger.runtime()); auto positioning = create_position_provider(io_service, trigger.runtime());
auto security = create_security_entity(trigger.runtime(), *positioning); auto security = create_security_entity(trigger.runtime(), *positioning);