# NvROS

**URL:** https://forums.developer.nvidia.com/t/nvros/83775
**Category:** DRIVE AGX Xavier General
**Tags:** ros
**Created:** [October 23, 2019, 11:34pm UTC](https://forums.developer.nvidia.com/t/nvros/83775 "2019-10-23T23:34:22Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![VerySimple](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@VerySimple](https://forums.developer.nvidia.com/u/VerySimple)
#### Post date: [October 23, 2019, 11:34pm UTC](https://forums.developer.nvidia.com/t/nvros/83775/1 "2019-10-23T23:34:22Z")

</div>

Hi,

Just wondering whether NvROS is based on ROS or ROS2?

Thanks!

---

<div class="post-metadata">

### Author: ![SteveNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/stevenv/32/14043_2.png) [@SteveNV](https://forums.developer.nvidia.com/u/SteveNV)
#### Post date: [October 24, 2019, 8:49am UTC](https://forums.developer.nvidia.com/t/nvros/83775/2 "2019-10-24T08:49:23Z")

</div>

Dear VerySimple,

NvROS is based on ROS1-Kinetic. Thanks.

---

<div class="post-metadata">

### Author: ![VerySimple](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@VerySimple](https://forums.developer.nvidia.com/u/VerySimple)
#### Post date: [October 24, 2019, 5:08pm UTC](https://forums.developer.nvidia.com/t/nvros/83775/3 "2019-10-24T17:08:18Z")

</div>

Thanks

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 9, 2020, 4:48am UTC](https://forums.developer.nvidia.com/t/nvros/83775/4 "2020-01-09T04:48:17Z")

</div>

Hello SteveNV,

If I use SDK Manager to flash Xavier with DRIVE 10.0, is the NvROS also based on ROS1-Kinetic? or it has been upgraded to ROS1-Melodic?

Thanks!

---

<div class="post-metadata">

### Author: ![SteveNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/stevenv/32/14043_2.png) [@SteveNV](https://forums.developer.nvidia.com/u/SteveNV)
#### Post date: [January 9, 2020, 11:34am UTC](https://forums.developer.nvidia.com/t/nvros/83775/5 "2020-01-09T11:34:28Z")

</div>

Dear hanyang.zhuang,

Drive Software 10.0 contains the ROS1-K frameworks not ROS1-M. Thanks.

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 10, 2020, 8:52am UTC](https://forums.developer.nvidia.com/t/nvros/83775/6 "2020-01-10T08:52:11Z")

</div>

Hi SteveNV,

I found in the tutorial about the NvROS in  
[https://docs.nvidia.com/drive/drive\_os\_5.1.12.0L/nvvib\_docs/index.html#page/DRIVE\_OS\_Linux\_SDK\_Development\_Guide%2FBootloader%2Frobot\_os.html%23wwpID0E0HZ0HA](https://docs.nvidia.com/drive/drive_os_5.1.12.0L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2FBootloader%2Frobot_os.html%23wwpID0E0HZ0HA)

But I’m still quite confused of how to implement it. Currently, my requirement is straight forward:  
On host, I will initiate a ros master and a rosnode to play rosbag or use simulation software generate realtime rostopics. The rostopics include sensor data and vehicle operation data.  
I would like to cross compile ROS or use NvROS on the Xavier System so that my controller can receive the rostopics, use DriveWorks to process the data, and send rostopics back to my host.

Would you please help explain more about which approach shall I take and what tools do I need?

Thanks a lot!

---

<div class="post-metadata">

### Author: ![SteveNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/stevenv/32/14043_2.png) [@SteveNV](https://forums.developer.nvidia.com/u/SteveNV)
#### Post date: [January 10, 2020, 11:05am UTC](https://forums.developer.nvidia.com/t/nvros/83775/7 "2020-01-10T11:05:51Z")

</div>

> [@""](#):
>
> Hi SteveNV,
> 
> I found in the tutorial about the NvROS in  
> [https://docs.nvidia.com/drive/drive\_os\_5.1.12.0L/nvvib\_docs/index.html#page/DRIVE\_OS\_Linux\_SDK\_Development\_Guide%2FBootloader%2Frobot\_os.html%23wwpID0E0HZ0HA](https://docs.nvidia.com/drive/drive_os_5.1.12.0L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2FBootloader%2Frobot_os.html%23wwpID0E0HZ0HA)
> 
> But I’m still quite confused of how to implement it. Currently, my requirement is straight forward:  
> On host, I will initiate a ros master and a rosnode to play rosbag or use simulation software generate realtime rostopics. The rostopics include sensor data and vehicle operation data.  
> I would like to cross compile ROS or use NvROS on the Xavier System so that my controller can receive the rostopics, use DriveWorks to process the data, and send rostopics back to my host.
> 
> Would you please help explain more about which approach shall I take and what tools do I need?
> 
> Thanks a lot!

Dear hanyang.zhuang,  
Could you please refer to the following link for the question? Thanks.

> **[ROS with DriveWorks on Xavier compilation and runtime issues](https://forums.developer.nvidia.com/default/topic/1068379/general/ros-with-driveworks-on-xavier-compilation-and-runtime-issues/)**
>
> Because now I can not cross compile for ROS, I build ROS on Xavier, but I meet the compilation issue for libgdal.so //usr/lib/libgdal.so.20: undefined reference to \`xercesc\_3\_2::DOMImplementationRegistry::getDOMImplementation(char16\_t const\*)'...

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 19, 2020, 5:56am UTC](https://forums.developer.nvidia.com/t/nvros/83775/8 "2020-01-19T05:56:09Z")

</div>

Hi SteveNV,

Thanks for your reply. I have installed ROS on my target and run it properly. However, there is some problem when I use host to cross-compile files using roscpp. I have opened another thread about it. So here I only would like to discuss more in NvRos.

If you compare following two links:  
[https://docs.nvidia.com/drive/drive\_os\_5.1.6.1L/nvvib\_docs/DRIVE\_OS\_Linux\_SDK\_Development\_Guide/baggage/modules.html](https://docs.nvidia.com/drive/drive_os_5.1.6.1L/nvvib_docs/DRIVE_OS_Linux_SDK_Development_Guide/baggage/modules.html)  
[https://docs.nvidia.com/drive/drive\_os\_5.1.12.0L/nvvib\_docs/DRIVE\_OS\_Linux\_SDK\_Development\_Guide/baggage/modules.html](https://docs.nvidia.com/drive/drive_os_5.1.12.0L/nvvib_docs/DRIVE_OS_Linux_SDK_Development_Guide/baggage/modules.html)  
They are different about NvROS module. DRIVE OS 5.1.6 has no information about NvROS and DRIVE OS 5.1.12 has the information about NvROS.

However, the question is I am using latest SDKmanager to install 10.0 to my host and target. Then the latest version of DRIVE OS is 5.1.6 which means it DOES NOT have NvROS. Can you help to figure out if I am not installing DRIVE OS correctly, or the NvROS module is not released yet? Thanks in advance!

---

<div class="post-metadata">

### Author: ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)
#### Post date: [January 19, 2020, 5:36pm UTC](https://forums.developer.nvidia.com/t/nvros/83775/9 "2020-01-19T17:36:51Z")

</div>

Hi hanyang.zhuang,

Drive SW releases is not intended to contain NvROS. That’s why DRIVE OS 5.1.6.1 development guide (for DRIVE OS in DRIVE Software 10.0) also has no the NvROS section inside. Thanks!

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 20, 2020, 1:44am UTC](https://forums.developer.nvidia.com/t/nvros/83775/10 "2020-01-20T01:44:02Z")

</div>

Hi Vick,

Thanks for your feedback. Then if I would like to use NvROS, how can I install and use it?

---

<div class="post-metadata">

### Author: ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)
#### Post date: [January 20, 2020, 4:33am UTC](https://forums.developer.nvidia.com/t/nvros/83775/11 "2020-01-20T04:33:31Z")

</div>

May I know why you need NvROS? Can you implement your own ROS nodes for your use cases with DRIVE OS APIs or DriveWorks API?

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 20, 2020, 5:28am UTC](https://forums.developer.nvidia.com/t/nvros/83775/12 "2020-01-20T05:28:29Z")

</div>

Hi Vick,

The main reason is that I do not know how to cross-compile my code which includes ros and driveworks. By following your guidance in this thread, I have installed ROS follows the thread  
[https://devtalk.nvidia.com/default/topic/1032206/faq/drive-px2-ros-cross-compilation/post/5251406/](https://devtalk.nvidia.com/default/topic/1032206/faq/drive-px2-ros-cross-compilation/post/5251406/)  
I have successfully installed ROS in /home/zhy/nvidia/nvidia\_sdk/DRIVE\_Software\_10.0\_Linux\_OS\_E3550/DRIVEOS/drive-t186ref-linux/targetfs\_a. However, I’m not very familiar with cmake and how to modify toolchain, so I would rather to simply include /opt/ros/melodic/indclude and the libraries in my CMakeLists.txt which looks like this. Because I think it’s too complicated to merge catkin\_make DriveWorks CMakeLists and cakint workspace CMakeLists.

CMakeLists.txt

```auto
project(ros_node C CXX)

set( Boost_DEBUG ON )
include_directories(
	${VIBRANTE_PDK}/targetfs_a/usr/include/aarch64-linux-gnu
	${VIBRANTE_PDK}/targetfs_a/opt/ros/melodic/include
) 
link_directories( ${VIBRANTE_PDK}/targetfs_a/usr/lib)
link_directories( ${VIBRANTE_PDK}/targetfs_a/opt/ros/melodic/lib)

set(PUBLIC_DOCS
    README.md
)

set(SOURCES
    ros_node.cpp
)

set(LIBRARIES
	boost
	roscpp
	rosconsole
	roscpp_serialization
	rostime
    samples_framework
    ${Driveworks_LIBRARIES}
)

#-------------------------------------------------------------------------------
# Final target
#-------------------------------------------------------------------------------
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBRARIES})
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Samples")

# ------------------------------------------------------------------------------
# Install target
# ------------------------------------------------------------------------------
sdk_add_sample(${PROJECT_NAME})

```

```auto
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-V5L.cmake \
-DVIBRANTE_PDK:STRING=/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux \
..
make -j && make install

```

But this does case a lot of errors such as:  
Errors

```auto
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cwchar:146:11: error: ‘::fwide’ has not been declared
   using ::fwide;
           ^ ~~~~
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cwchar:147:11: error: ‘::fwprintf’ has not been declared
   using ::fwprintf;
           ^ ~~~~~~~
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cwchar:148:11: error: ‘::fwscanf’ has not been declared
   using ::fwscanf;
           ^ ~~~~~~
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/include/c++/7.3.1/cwchar:149:11: error: ‘::getwc’ has not been declared
   using ::getwc;
..........
In file included from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/fpclassify.hpp:20:0,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/round.hpp:16,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/opt/ros/melodic/include/ros/time.h:58,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/opt/ros/melodic/include/ros/serialization.h:34,
                 from /home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/opt/ros/melodic/include/std_msgs/String.h:14,
                 from /home/zhy/Desktop/dwTests/src/ros_node/ros_node.cpp:40:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/detail/fp_traits.hpp: In static member function ‘static void boost::math::detail::fp_traits_non_native<float, boost::math::detail::single_precision>::get_bits(float, uint32_t&)’:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/detail/fp_traits.hpp:187:55: error: ‘memcpy’ is not a member of ‘std’
     static void get_bits(float x, uint32_t& a) { std::memcpy(&a, &x, 4); }
                                                       ^ ~~~~~
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/detail/fp_traits.hpp:187:55: note: suggested alternative: ‘decay’
     static void get_bits(float x, uint32_t& a) { std::memcpy(&a, &x, 4); }
                                                       ^ ~~~~~
                                                       decay
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/detail/fp_traits.hpp: In static member function ‘static void boost::math::detail::fp_traits_non_native<float, boost::math::detail::single_precision>::set_bits(float&, uint32_t)’:
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/detail/fp_traits.hpp:188:55: error: ‘memcpy’ is not a member of ‘std’
     static void set_bits(float& x, uint32_t a) { std::memcpy(&x, &a, 4); }
                                                       ^ ~~~~~
/home/zhy/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a/usr/include/aarch64-linux-gnu/boost/math/special_functions/detail/fp_traits.hpp:188:55: note: suggested alternative: ‘decay’
     static void set_bits(float& x, uint32_t a) { std::memcpy(&x, &a, 4); }
                                                       ^ ~~~~~
                                                       decay

```

Therefore, I think I’m not doing it correctly. So my question is that do I have to write my toolchain cmake file as indicated in aforementioned url and use catkin\_make\_isolated to cross-compile it? Is there to be some possibly easier approach to use ros?  
Thanks!

---

<div class="post-metadata">

### Author: ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)
#### Post date: [January 20, 2020, 8:12pm UTC](https://forums.developer.nvidia.com/t/nvros/83775/13 "2020-01-20T20:12:45Z")

</div>

You can refer to [ROS/Tutorials/CreatingPackage - ROS Wiki](http://wiki.ros.org/ROS/Tutorials/CreatingPackage) and start from developing a simple driveworks ROS node. It will be more easy.

If you want to manipulate an CMAKE\_TOOLCHAIN\_FILE for your projects, you may need to use catkin\_make\_isolated as an alternative for catkin\_make.

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 21, 2020, 1:17am UTC](https://forums.developer.nvidia.com/t/nvros/83775/14 "2020-01-21T01:17:59Z")

</div>

Hi VickNV,

I have succeeded in using ROS node and DW in host compilation. I follow the instruction to modify my CMAKE\_TOOLCHAIN\_FILE and apply catkin\_make\_isolated so the ROS node can communicate with rosmaster and also utilize DW functions.

However, when it comes to cross compilation, the modification of CMAKE\_TOOLCHAIN\_FILE is much more complicated and there are too many errors. Since there are already many autonomous driving system or simulation software using ROS, I strongly recommended Nvidia to provide a simple example to cross compile ROS node and DW for the target Xavier.

I’m using the simplest ROS node as [http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29](http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29).  
And also the hello\_world sample.  
The sample here only tells how to cross compile ROS node alone. [https://devtalk.nvidia.com/default/topic/1032206/faq/drive-px2-ros-cross-compilation/post/5251406/](https://devtalk.nvidia.com/default/topic/1032206/faq/drive-px2-ros-cross-compilation/post/5251406/)

---

<div class="post-metadata">

### Author: ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)
#### Post date: [January 21, 2020, 3:10pm UTC](https://forums.developer.nvidia.com/t/nvros/83775/15 "2020-01-21T15:10:52Z")

</div>

> [@](#):
>
> However, when it comes to cross compilation, the modification of CMAKE\_TOOLCHAIN\_FILE is much more complicated and there are too many errors.
> 
> I’m using the simplest ROS node as [http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29](http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29).  
> And also the hello\_world sample.

Could you start from [http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29](http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29) only?

After that, when you try to add hello\_world package, the main things should be to manipulate its CMakeLists.txt with necessary include\_directories and target\_link\_libraries. Below are snippets of self-documenting CMakeLists.txt generated by catkin\_create\_pkg tool.

```auto
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
# ${catkin_INCLUDE_DIRS}
)
...
## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )

```

---

<div class="post-metadata">

### Author: ![hanyang.zhuang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hanyang.zhuang](https://forums.developer.nvidia.com/u/hanyang.zhuang)
#### Post date: [January 22, 2020, 1:52am UTC](https://forums.developer.nvidia.com/t/nvros/83775/16 "2020-01-22T01:52:10Z")

</div>

Hi VickNV,

This issue is resolved now and what you have provided is exactly what I have done. Thanks a lot!

---

<div class="post-metadata">

### Author: ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)
#### Post date: [October 12, 2021, 8:04pm UTC](https://forums.developer.nvidia.com/t/nvros/83775/17 "2021-10-12T20:04:56Z")

</div>


