Depending on which transport is used for micro-ROS specific configurations, the following should be done.
-
Copy the following files to the source directory:
extra_sources/microros_transports/usb_transport.c
extra_sources/microros_transports/usb_descriptor.c
-
Double click on the
configuration.xml
file of your project and go to theStacks
tab. -
Select
New Stack -> Middleware -> USB -> USB PCDC driver on r_usb_pcdc
. -
Go to
Clocks
tab and configureUCLK
clock to match 48MHz (Match the values on the highlighted boxes): -
Save the modifications by clicking on
Generate Project Content
.
The configuration of this transports is board dependant:
EK-RA6M5
-
Copy the following files to the source directory:
extra_sources/microros_transports/uart_transport.c
-
Double click on the
configuration.xml
file of your project and go to theStacks
tab. -
Select
New Stack -> Driver -> Connectivity -> r_src_uart
. -
Optional: in order to set P411 and P410 as Tx/Rx first disable SPI1
-
Go to the component properties and configure the Tx/Rx pinout:
-
Save the modifications clicking on
Generate Project Content
.
MCK-RA6T2
-
Copy the following files to the source directory:
extra_sources/microros_transports/uart_transport.c
-
Double click on the
configuration.xml
file of your project and go to theStacks
tab. -
Select
New Stack -> Driver -> Connectivity -> r_src_b_uart
. -
Go to
Clocks
tab and enableSCISPICLK
clock.Example clock configuration:
-
Go to the Pins tab and configure the SCI port 0 and its pinout:
Optional: in order to set PA09 and PA10 as Tx/Rx first disable the timers GPT8 and GPT9
-
Save the modifications clicking on
Generate Project Content
.
-
Copy the following files to the source directory:
extra_sources/microros_transports/udp_transport_freeRTOS.c
-
Double click on the
configuration.xml
file of your project and go to theStacks
tab. -
Select
New Stack -> Networking -> FreeRTOS + TCP
. -
Configure the properties of the
FreeRTOS + TCP component
:-
Common -> vApplicationIPNetworkEventHook
toDisable
. -
Common -> DHCP Register Hostname
toDisable
. -
Optional: Enable DHCP
Common -> Use DHCP
toEnable
.Note: If DHCP is disabled, the board network parameters can be configured on the transport source file
udp_transport_freeRTOS.c
-
Optional: Increase number of buffers avaliable to the IP stack on
Common -> Total number of avaliable network buffers
.
-
-
Increase number of Ethernet Tx buffers on
g_ether0 component -> Module g_ether0 Ethernet Driver on r_ether -> Buffers -> Number of RX buffer
to 4: -
Save the modifications by clicking on
Generate Project Content
. -
Configure micro-ROS agent IP and port passing a freeRTOS
freertos_sockaddr
struct to thermw_uros_set_custom_transport
function:struct freertos_sockaddr remote_addr; remote_addr.sin_family = FREERTOS_AF_INET; remote_addr.sin_port = FreeRTOS_htons(8888); remote_addr.sin_addr = FreeRTOS_inet_addr("192.168.1.185"); rmw_uros_set_custom_transport( false, (void *) &remote_addr, renesas_e2_transport_open, renesas_e2_transport_close, renesas_e2_transport_write, renesas_e2_transport_read);
-
Copy the following files to the source directory:
extra_sources/microros_transports/udp_transport_threadX.c
-
Double click on the
configuration.xml
file of your project and go to theStacks
tab. -
Select
New Stack -> Networking -> Azure RTOS NetX Duo DHCP IPv4 Client
. -
Click on Add NetX Duo Network Driver and select
New -> NetX Duo Ethernet Driver (rm_netxduo_ether)
: -
Click on Add NetX Duo Packet Pool and select
Use -> g_packet_pool0 Azure RTOS NetX Duo Packet Pool Instance
: -
Optional: Increase number of buffers avaliable to the IP stack on
g_packet_pool0
properties onModule g_packet_pool0 Azure RTOS NetX Duo Packet Pool Instance -> Number of Packets in Pool
. -
Save the modifications by clicking on
Generate Project Content
. -
Configure micro-ROS agent IP and port passing a
custom_transport_args
struct to thermw_uros_set_custom_transport
function:custom_transport_args remote_addr = { .agent_ip_address=IP_ADDRESS(192,168,1,185), .agent_port=8888 }; rmw_uros_set_custom_transport( false, (void *) &remote_addr, renesas_e2_transport_open, renesas_e2_transport_close, renesas_e2_transport_write, renesas_e2_transport_read);
This transport supports Renesas Wi-Fi-Pmod-Expansion-Board based on Silex SX-ULPGN module.
Support for other wifi modules can be added to the FSP as explained on chapter 4. Adding Support for New Wi-Fi module
of this document:
Getting Started with the Wi-Fi Modules on FSP
Note: This configuration is valid for the connector PMOD1 (J26)
-
Copy the following files to the source directory:
extra_sources/microros_transports/wifi_transport_freeRTOS.c
-
Double click on the
configuration.xml
file of your project and go to theComponents
tab. -
Enable the following components:
-
Go to the
Stacks
tab and add aAWS Silex WiFi Sockets Wrapper
module. -
Remove the
AWS Cellular/WiFi MbedTLS Bio
submodule of the created component:Right click -> Delete
. -
Enable
Common -> General -> Use Mutexes
on the micro-ROS thread properties. -
Configure the module reset pinout on the
rm_wifi_onchip_silex
module properties:- Set
Common -> Module Reset Port
to 3. - Set
Common -> Module Reset Pin
to 11.
- Set
-
Configure the properties of the PMOD connection under the UART component properties (
g_uart0 UART (r_sci_uart)
)-
Enter Enable
FIFO support
,DTC support
andFlow control support
oncommon
properties -
Add
DTC drivers
for Transmission and Reception: -
Select the SCI port 9 on
Module g_uart0 UART (r_sci_uart) -> General -> Channel
. -
Go to the Pins tab and configure the SCI port and its pinout:
Optional: in order to set P203 and P202 as Tx/Rx first disable SPI0
-
Optional: To increase data throughput, increase the baud rate on
Module g_uart0 UART (r_sci_uart) -> Baud -> Baud Rate
. Values up to460800 bauds
has been tested
-
-
Save the modifications by clicking on
Generate Project Content
. -
Configure the transport connection passing a
custom_transport_args
struct to thermw_uros_set_custom_transport
function:-
Configure the wifi network with a
WIFINetworkParams_t
object:// Configure wifi network WIFINetworkParams_t network_conf = { .ucChannel = 0, .ucSSID = "[YOUR_SSID_HERE]", .xPassword.xWPA.cPassphrase = "[YOUR_PSK_HERE]", .xSecurity = eWiFiSecurityWPA2, };
Notes: - Currently only the following security protocols are supported:
eWiFiSecurityOpen
,eWiFiSecurityWPA
andeWiFiSecurityWPA2
- The network ssid and password length is limited to 31 characters -
Configure agent IP and port on a
custom_transport_args
object and pass it down to thermw_uros_set_custom_transport
method:// Add configuration to transport args custom_transport_args wifi_args = { .network_conf = &network_conf, .agent_ip = "192.168.1.93", .agent_port = 8888 }; rmw_uros_set_custom_transport( false, (void *) &wifi_args, renesas_e2_transport_open, renesas_e2_transport_close, renesas_e2_transport_write, renesas_e2_transport_read );
-
-
Copy the following files to the source directory:
extra_sources/microros_transports/canfd_transport.c
-
Double click on the
configuration.xml
file of your project and go to theStacks
tab. -
Select
New Stack -> Driver -> Connectivity -> r_canfd
. -
Go to
Clocks
tab: -
Configure CAN reception:
Common -> Reception -> Message Buffers -> Number of Buffers
to0
.Common -> Reception -> FIFOs -> FIFO 0 -> Enable
toEnabled
Common -> Reception -> FIFOs -> FIFO 0 -> Interrupt Mode
toEvery Frame
.Common -> Reception -> FIFOs -> FIFO 0 -> Payload Size
to64 bytes
.
-
Configure CAN interrupts:
- Enable
Module g_canfd0 CANFD Driver on r_canfd -> Transmit Interrupts -> TXMB 0
. - Set
Module g_canfd0 CANFD Driver on r_canfd -> Interrupts -> Channel Interrupt Priority Level
toPriority 3
. - Enable all interrupts on
Module g_canfd0 CANFD Driver on r_canfd -> Channel Error Interrupts
.
- Enable
-
Configure CAN component:
-
Configure your CAN FD Bitrate:
-
Modify micro-ROS library build options:
-
Create a file named
app_colcon.meta
on your project main directory. -
Add the following configuration to the file:
{ "names": { "rmw_microxrcedds": { "cmake-args": [ "-DRMW_UXRCE_STREAM_HISTORY=8" ] }, "microxrcedds_client": { "cmake-args": [ "-DUCLIENT_CUSTOM_TRANSPORT_MTU=63" ] }, } }
-
Optional: Increase the number of stream buffers to match your message requirements with
RMW_UXRCE_STREAM_HISTORY
.This parameter will control the maximum payload of a publish message:
RMW_UXRCE_STREAM_HISTORY * UCLIENT_CUSTOM_TRANSPORT_MTU (bytes)
-
To rebuild the micro-ROS library, clean and rebuild your project.
-
-
Set CAN transport configuration on the
canfd_transport.c
file: -
Save the modifications clicking on
Generate Project Content
.