![](https://community.stereolabs.com/uploads/default/original/2X/0/02adae85d6d2c5ab017cbfb2500e797cc1d1ebce.png)
[ Stereolabs – 16 Sep 22 ](https://www.stereolabs.com/blog/getting-started-
with-ros2-on-jetson-agx-orin/ "10:01AM - 16 September 2022")


[ ![@faev999](https://avatars.githubusercontent.com/u/9406567?s=80&v=4)
](/faev999)


    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)


Sorry, something went wrong.


None yet


[ Latest main does not show anything in RViz when running examples  Ekumen-
OS/beluga#123  ](/Ekumen-OS/beluga/issues/123)


#  Black Screen on version 11.2.5  #948


-> Black screen


  * [ Code  ](/ros2/rviz)
  * [ Issues  ](/ros2/rviz/issues)
  * [ Pull requests  ](/ros2/rviz/pulls)
  * [ Actions  ](/ros2/rviz/actions)
  * [ Projects  ](/ros2/rviz/projects)
  * [ Wiki  ](/ros2/rviz/wiki)
  * [ Security  ](/ros2/rviz/security)
  * [ Insights  ](/ros2/rviz/pulse)


-> still black screen


  * With the foxy image, Rviz2 shows the grid.
  * With the humble image, Rviz2 shows a black view.
  * With the humble image and ` ipc: host ` , Rviz2 still shows a black display


* Product


[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-
name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-
repo&source_repo=ros2%2Frviz)


#  Search code, repositories, users, issues, pull requests...


Name  |  grid-map-rviz-plugin
---|---
Version  |  2.0.0-1 (ac4adfc89899ca73bdc22c90b0771a363ecf01b4)
Summary  |
Description  |  RViz plugin for displaying grid map messages.
Section  |  devel
License  |  BSD
Homepage  |  [ https://wiki.ros.org ](https://wiki.ros.org)
Recipe file  |  generated-recipes/grid-map/grid-map-rviz-plugin_2.0.0-1.bb
Layer  |  [ meta-ros2-humble ](/layerindex/branch/master/layer/meta-
ros2-humble/) (master branch)
Inherits  |


**[ neutronztar ](/neutronztar) ** commented  Feb 1, 2023  •


  * ament-cmake-native
  * cmake-native
  * grid-map-cmake-helpers
  * grid-map-msgs
  * grid-map-ros
  * ninja-native
  * python3-native
  * qtbase
  * rclcpp
  * rviz-common
  * rviz-ogre-vendor
  * rviz-rendering
  * virtual/i686-oe-linux-compilerlibs
  * virtual/i686-oe-linux-gcc
  * virtual/libc


Copy link


Email Address


**[ Stefan-working ](/Stefan-working) ** commented  Feb 13, 2023


All reactions


#  Saved searches


[ Jian  ](https://community.stereolabs.com/u/Jian) June 5, 2023, 1:27pm  3


There is really a thing between ubuntu 20.04 and 22.04:


[
![@elms](https://avatars.githubusercontent.com/u/7052058?s=80&u=dce954bbe831c73f7e11b95127e7440d92045eac&v=4)
](/elms)


Sorry, something went wrong.


  * [ Notifications ](/login?return_to=%2Fros2%2Frviz)
  * [ Fork  196  ](/login?return_to=%2Fros2%2Frviz)
  * [ Star  249  ](/login?return_to=%2Fros2%2Frviz)


[ ![ros.org](/custom/images/ros_org.png) ](/) |  [ About
](http://www.ros.org/about-ros) | [ Support ](/Support) | [ Discussion Forum
](http://discourse.ros.org/) | [ Index ](http://index.ros.org/) | [ Service
Status ](http://status.ros.org/) | [ ros @ Robotics Stack Exchange
](https://robotics.stackexchange.com/questions/tagged/ros)
---|---
![](/custom/images/menu_left.png) [
![Documentation](/custom/images/menu_documentation.png) ](/)
![](/custom/images/menu_spacer.png) [ ![Browse
Software](/custom/images/menu_browse_software.png)
](https://index.ros.org/packages) ![](/custom/images/menu_spacer.png) [
![News](/custom/images/menu_news.png) ](https://discourse.ros.org/c/general)
![](/custom/images/menu_spacer.png) [
![Download](/custom/images/menu_download.png) ](/ROS/Installation)
![](/custom/images/menu_right.png)

  * [ rosbridge_suite ](/rosbridge_suite)
####  ROS 2 Documentation
The ROS Wiki is for ROS 1. Are you using ROS 2 ( [ Humble
](http://docs.ros.org/en/humble/) , [ Iron ](http://docs.ros.org/en/iron/) ,
or [ Rolling ](http://docs.ros.org/en/rolling/) )?
[ Check out the ROS 2 Project Documentation ](http://docs.ros.org)
Package specific documentation can be found on [ index.ros.org
](https://index.ros.org)
#  Wiki
  * [ Distributions ](/Distributions)
  * [ ROS/Installation ](/ROS/Installation)
  * [ ROS/Tutorials ](/ROS/Tutorials)
  * [ RecentChanges ](/RecentChanges)
  * [ rosbridge_suite ](/rosbridge_suite)
#  Page
  * Immutable Page
  * Comments
  * [ Info ](/action/info/rosbridge_suite?action=info)
  * [ Attachments ](/action/AttachFile/rosbridge_suite?action=AttachFile)
  * More Actions:  Raw Text  Print View  Render as Docbook  Delete Cache  \------------------------  Check Spelling  Like Pages  Local Site Map  \------------------------  Rename Page  Copy Page  Delete Page  \------------------------  My Pages  Subscribe User  \------------------------  Remove Spam  Revert to this revision  Package Pages  Sync Pages  \------------------------  CreatePdfDocument  Load  RawFile  Save  SlideShow
#  User
  * [ Login ](/action/login/rosbridge_suite?action=login)
melodic  noetic  _Show EOL distros:_
_EOL distros:_ fuerte  groovy  hydro  indigo  jade  kinetic  lunar


[ ](https://github.com/)


from the humble one, it is OpenGL 4.5:


Powered by [ Discourse ](https://www.discourse.org) , best viewed with
JavaScript enabled


* glxgears now works:


[
![@VRichardJP](https://avatars.githubusercontent.com/u/18645627?s=80&u=18e9a7e8c90b864fe3a73b283a4081a37cfdbf9a&v=4)
](/VRichardJP)


19 tasks


[ Cartesian MotionPlanning and Rviz plugin issue.  PickNikRobotics/pick_ik#29
](/PickNikRobotics/pick_ik/issues/29)


[ ![@clalancette](https://avatars.githubusercontent.com/u/163000?s=40&v=4)
](/clalancette) [ clalancette ](/clalancette) added the [ backlog
](/ros2/rviz/labels/backlog) label  Mar 17, 2022


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


I can verify the issue in docker with an image based on the latest ubuntu22.04
and ros2 humble from the latest apt packages. This is not on WSL. The base
system is also ubuntu22.04.

---

All reactions


**[ clalancette ](/clalancette) ** commented  Feb 1, 2023


All reactions


Query


Error in the terminal:


Closed


Copy link


    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)


    docker images | grep osrf
    osrf/ros                                                       foxy-desktop                  0630734c5305   3 hours ago         3.12GB
    osrf/ros                                                       humble-desktop                734e74e8d052   27 hours ago        3.57GB


[ Sign in
](/login?return_to=https%3A%2F%2Fgithub.com%2Fros2%2Frviz%2Fissues%2F834)


Email Address


[ meta-ros2-humble ](/layerindex/branch/master/layer/meta-ros2-humble/) |  [
grid-map-rviz-plugin_2.0.0-1.bbappend ]()
---|---
[ meta-ros2-iron ](/layerindex/branch/master/layer/meta-ros2-iron/) |  [ grid-
map-rviz-plugin_2.1.0-1.bbappend ]()

##  Other branches


    $ rocker --x11 osrf/ros:humble-desktop
    # rviz2


Seeing the same issue in docker Ubuntu 20.04, except on a Linux host.
Launching rviz2 around 10+ times does make the grid finally render though, I
have not found any significant data in logs, straces, etc to provide any
clues.

---

😕  1  trishmapow reacted with confused emoji


Sorry, something went wrong.


[
![@trishmapow](https://avatars.githubusercontent.com/u/17211063?s=80&u=03d434d5be14c18d172b97e122025705a4187017&v=4)
](/trishmapow)


Assignees


[
![@JensVanhooydonck](https://avatars.githubusercontent.com/u/5812950?s=80&u=9f6c6f361e6bd6a54941fc83a75795b1c10d97f7&v=4)
](/JensVanhooydonck)


Include my email address so I can be contacted


There is a lot of information in here, but everything in this issue points to
user configuration, not problems in the code. Since that seems to be the case,
I'm going to close this issue out; for further issues on getting RViz to run,
please use [ https://answers.ros.org ](https://answers.ros.org) .

---

All reactions


  * [ Code  ](/ros2/rviz)
  * [ Issues  96  ](/ros2/rviz/issues)
  * [ Pull requests  31  ](/ros2/rviz/pulls)
  * [ Actions  ](/ros2/rviz/actions)
  * [ Projects  0  ](/ros2/rviz/projects)
  * [ Wiki  ](/ros2/rviz/wiki)
  * [ Security  ](/ros2/rviz/security)
  * [ Insights  ](/ros2/rviz/pulse)


[
![@VRichardJP](https://avatars.githubusercontent.com/u/18645627?s=80&u=18e9a7e8c90b864fe3a73b283a4081a37cfdbf9a&v=4)
](/VRichardJP)


  * [ Code  ](/ros2/rviz)
  * [ Issues  ](/ros2/rviz/issues)
  * [ Pull requests  ](/ros2/rviz/pulls)
  * [ Actions  ](/ros2/rviz/actions)
  * [ Projects  ](/ros2/rviz/projects)
  * [ Wiki  ](/ros2/rviz/wiki)
  * [ Security  ](/ros2/rviz/security)
  * [ Insights  ](/ros2/rviz/pulse)


**[ trishmapow ](/trishmapow) ** commented  Mar 1, 2022


* 👍  2 reactions


    $ sudo apt list --installed | grep rviz

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

    ros-humble-rviz-assimp-vendor/now 11.2.2-1jammy.20220520.000232 amd64 [installed,upgradable to: 11.2.5-1jammy.20230112.141217]
    ros-humble-rviz-common/now 11.2.2-1jammy.20220908.235220 amd64 [installed,upgradable to: 11.2.5-1jammy.20230120.222053]
    ros-humble-rviz-default-plugins/now 11.2.2-1jammy.20220909.025059 amd64 [installed,upgradable to: 11.2.5-1jammy.20230124.071257]
    ros-humble-rviz-imu-plugin/now 2.1.1-2jammy.20220909.002940 amd64 [installed,upgradable to: 2.1.3-1jammy.20230120.224430]
    ros-humble-rviz-ogre-vendor/now 11.2.2-1jammy.20220520.000242 amd64 [installed,upgradable to: 11.2.5-1jammy.20230112.141237]
    ros-humble-rviz-rendering/now 11.2.2-1jammy.20220520.003608 amd64 [installed,upgradable to: 11.2.5-1jammy.20230112.145716]
    ros-humble-rviz2/now 11.2.2-1jammy.20220909.043241 amd64 [installed,upgradable to: 11.2.5-1jammy.20230124.081000]


    $ sudo apt list --installed | grep rviz

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

    ros-humble-rviz-assimp-vendor/now 11.2.3-1jammy.20220913.012626 amd64 [installed,upgradable to: 11.2.5-1jammy.20230112.141217]
    ros-humble-rviz-common/now 11.2.3-1jammy.20221019.162459 amd64 [installed,upgradable to: 11.2.5-1jammy.20230120.222053]
    ros-humble-rviz-default-plugins/now 11.2.3-1jammy.20221019.165603 amd64 [installed,upgradable to: 11.2.5-1jammy.20230124.071257]
    ros-humble-rviz-ogre-vendor/now 11.2.3-1jammy.20220913.012843 amd64 [installed,upgradable to: 11.2.5-1jammy.20230112.141237]
    ros-humble-rviz-rendering/now 11.2.3-1jammy.20220913.020348 amd64 [installed,upgradable to: 11.2.5-1jammy.20230112.145716]
    ros-humble-rviz2/now 11.2.3-1jammy.20221019.180719 amd64 [installed,upgradable to: 11.2.5-1jammy.20230124.081000]


      cpp-12 dctrl-tools dkms gcc-12 keyboard-configuration kmod libasan8 libgcc-12-dev liblocale-gettext-perl libnvidia-cfg1-515 libnvidia-common-515 libnvidia-compute-515 libnvidia-decode-515 libnvidia-egl-wayland1 libnvidia-encode-515 libnvidia-extra-515 libnvidia-fbc1-515
      libnvidia-gl-515 libtsan2 libxcvt0 nvidia-compute-utils-515 nvidia-dkms-515 nvidia-driver-515 nvidia-kernel-common-515 nvidia-kernel-source-515 nvidia-utils-515 udev xserver-xorg-core xserver-xorg-video-nvidia-515

---

All reactions


I'm running ROS 2 foxy on WSL Ubuntu 20.04 with the precompiled packages. When
I run ` rviz2 ` I get an empty grey area where the 3D grid should be. If I
publish e.g. pointcloud data nothing is displayed. I have tried using ` export
LIBGL_ALWAYS_INDIRECT=0 ` and also launching rviz2 through an Xrdp session,
with no success. Edit: ` export LIBGL_ALWAYS_SOFTWARE=true ` does work without
acceleration.
RViz version Alpha compiled against Qt 5.12.8, OGRE version 1.12.1
(Rhagorthua). Windows 11 Pro 21H2 22000.493, WSL kernel 5.10.60.1, Intel Iris
Xe graphics 30.0.100.9864.


  * [ rosbridge_library ](/rosbridge_library?distro=melodic)
  * [ rosbridge_server ](/rosbridge_server?distro=melodic)
** Jenkins jobs  (6) **
  * [ source ubuntu bionic ](https://build.ros.org/view/Msrc_uB/job/Msrc_uB__rosbridge_suite__ubuntu_bionic__source)
  * [ binary ubuntu bionic amd64 ](https://build.ros.org/view/Mbin_uB64/job/Mbin_uB64__rosbridge_suite__ubuntu_bionic_amd64__binary)
  * [ binary ubuntu bionic armhf ](https://build.ros.org/view/Mbin_ubhf_uBhf/job/Mbin_ubhf_uBhf__rosbridge_suite__ubuntu_bionic_armhf__binary)
  * [ binary ubuntu bionic arm64 ](https://build.ros.org/view/Mbin_ubv8_uBv8/job/Mbin_ubv8_uBv8__rosbridge_suite__ubuntu_bionic_arm64__binary)
  * [ devel ubuntu bionic amd64 ](https://build.ros.org/view/Mdev/job/Mdev__rosbridge_suite__ubuntu_bionic_amd64)
  * [ doc ](https://build.ros.org/view/Mdoc/job/Mdoc__rosbridge_suite__ubuntu_bionic_amd64)
#  Package Summary
Released
Continuous Integration:  144 / 144
  * Build history (last 5 of 10 builds):
  * [ #54  18-Oct-2022 19:00  144 / 144  ](https://build.ros.org//job/Mdev__rosbridge_suite__ubuntu_bionic_amd64/54/)
  * [ #53  18-Oct-2022 13:00  144 / 144  ](https://build.ros.org//job/Mdev__rosbridge_suite__ubuntu_bionic_amd64/53/)
  * [ #52  17-Oct-2022 18:00  144 / 144  ](https://build.ros.org//job/Mdev__rosbridge_suite__ubuntu_bionic_amd64/52/)
  * [ #51  06-Oct-2022 19:00  144 / 144  ](https://build.ros.org//job/Mdev__rosbridge_suite__ubuntu_bionic_amd64/51/)
  * [ #50  04-Oct-2022 20:00  144 / 144  ](https://build.ros.org//job/Mdev__rosbridge_suite__ubuntu_bionic_amd64/50/)
Documented
Rosbridge provides a JSON API to ROS functionality for non-ROS programs. There
are a variety of front ends that interface with rosbridge, including a
WebSocket server for web browsers to interact with. Rosbridge_suite is a meta-
package containing rosbridge, various front end packages for rosbridge like a
WebSocket package, and helper packages.
  * Maintainer status: maintained
  * Maintainer: Russell Toris <rctoris AT wpi DOT edu>, Jihoon Lee <jihoonlee.in AT gmail DOT com>
  * Author: Jonathan Mace <jonathan.c.mace AT gmail DOT com>
  * License: BSD
  * Bug / feature tracker: [ https://github.com/RobotWebTools/rosbridge_suite/issues ](https://github.com/RobotWebTools/rosbridge_suite/issues)
  * Source: git [ https://github.com/RobotWebTools/rosbridge_suite.git ](https://github.com/RobotWebTools/rosbridge_suite) (branch: ros1)
_**rosbridge_suite** : [ rosapi ](/rosapi?distro=noetic) | [ rosbridge_library
](/rosbridge_library?distro=noetic) | [ rosbridge_server
](/rosbridge_server?distro=noetic) _
**Package Links**
  * [ Tutorials ](/rosbridge_suite/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosbridge_suite/page:1/)
  * [ Changelog ](http://docs.ros.org/en/noetic/changelogs/rosbridge_suite/changelog.html)
  * [ Change List ](/rosbridge_suite/ChangeList)
  * [ Reviews ](/rosbridge_suite/Reviews)
** Dependencies  (4) **


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


edited


[ ![@clalancette](https://avatars.githubusercontent.com/u/163000?s=80&v=4)
](/clalancette)


I observed something interesting though:
In the fovy container, OpenGL 3.1 is used:


[
![@VRichardJP](https://avatars.githubusercontent.com/u/18645627?s=40&u=18e9a7e8c90b864fe3a73b283a4081a37cfdbf9a&v=4)
](/VRichardJP) [ VRichardJP ](/VRichardJP) mentioned this issue  Feb 2, 2023


Installation of ROS2 and ZED ROS2 wrapper were successful.


But no issue with ` ubuntu:20.04 ` :


Closed


Pick a username


Copy link


[ backlog  ](/ros2/rviz/labels/backlog)


* same for rviz2 on humble:


[ Log in ](/accounts/login/?next=/layerindex/recipe/388991/)


Hi [ @Jian ](/u/jian)
you must install the ` ros-humble-grid-map-rviz-plugin ` package:
` sudo apt install ros-humble-grid-map-rviz-plugin `


  * Source: git [ https://github.com/RobotWebTools/rosbridge_suite.git ](https://github.com/RobotWebTools/rosbridge_suite) (branch: master)
_**rosbridge_suite** : [ rosapi ](/rosapi?distro=hydro) | [ rosbridge_library
](/rosbridge_library?distro=hydro) | [ rosbridge_server
](/rosbridge_server?distro=hydro) _
**Package Links**
  * [ Tutorials ](/rosbridge_suite/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosbridge_suite/page:1/)
  * [ Changelog ](http://docs.ros.org/en/hydro/changelogs/rosbridge_suite/changelog.html)
  * [ Change List ](/rosbridge_suite/ChangeList)
  * [ Reviews ](/rosbridge_suite/Reviews)
** Dependencies  (4) **
  * [ catkin ](/catkin?distro=hydro)
  * [ rosapi ](/rosapi?distro=hydro)
  * [ rosbridge_library ](/rosbridge_library?distro=hydro)
  * [ rosbridge_server ](/rosbridge_server?distro=hydro)
** Used by  (1) **
  * [ robot_web_tools ](/robot_web_tools?distro=hydro)
#  Package Summary
Released
Continuous Integration
Documented
Rosbridge provides a JSON API to ROS functionality for non-ROS programs. There
are a variety of front ends that interface with rosbridge, including a
WebSocket server for web browsers to interact with. Rosbridge_suite is a meta-
package containing rosbridge, various front end packages for rosbridge like a
WebSocket package, and helper packages.
  * Maintainer status: maintained
  * Maintainer: Russell Toris <rctoris AT wpi DOT edu>, Jihoon Lee <jihoonlee.in AT gmail DOT com>
  * Author: Jonathan Mace <jonathan.c.mace AT gmail DOT com>
  * License: BSD
  * Bug / feature tracker: [ https://github.com/RobotWebTools/rosbridge_suite/issues ](https://github.com/RobotWebTools/rosbridge_suite/issues)
  * Source: git [ https://github.com/RobotWebTools/rosbridge_suite.git ](https://github.com/RobotWebTools/rosbridge_suite) (branch: master)
_**rosbridge_suite** : [ rosapi ](/rosapi?distro=indigo) | [ rosbridge_library
](/rosbridge_library?distro=indigo) | [ rosbridge_server
](/rosbridge_server?distro=indigo) _
**Package Links**
  * [ Tutorials ](/rosbridge_suite/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosbridge_suite/page:1/)
  * [ Changelog ](http://docs.ros.org/en/indigo/changelogs/rosbridge_suite/changelog.html)
  * [ Change List ](/rosbridge_suite/ChangeList)


Doesn't seem like this downgraded all of rviz.


Cancel  Submit feedback


    $ wget http://snapshots.ros.org/humble/2022-12-16/ubuntu/pool/main/r/ros-humble-rviz-rendering/ros-humble-rviz-rendering_11.2.4-1jammy.20221108.154346_amd64.deb
    $ sudo dpkg -i ros-humble-rviz-rendering_11.2.4-1jammy.20221108.154346_amd64.deb


    libegl-mesa0 libegl1-mesa-dev libgbm-dev libgbm1 libgl1-mesa-dev
      libgl1-mesa-dri libglapi-mesa libglx-mesa0 libllvm15 libpam-modules
      libpam-modules-bin libpam-runtime libpam0g libssl-dev libssl3 linux-libc-dev
      openssl python3-colcon-core python3-colcon-defaults python3-colcon-mixin
      python3-colcon-python-setup-py


[ git://github.com/ros2-gbp/grid_map-release
](https://github.com/ros2-gbp/grid_map-release)
---

##  Patches


Name


I see, in my case, both the docker image and the host have exactly the same
versions:


[ Search syntax tips ](https://docs.github.com/search-github/github-code-
search/understanding-github-code-search-syntax)


Did I miss some configuration?


Clear


I’m trying to follow the tutorial here to config ROS2 on Jetson AGX Orin Dev
Kit


#  Saved searches


[ ![@maltoseslope](https://avatars.githubusercontent.com/u/11661124?s=40&v=4)
](/maltoseslope) [ maltoseslope ](/maltoseslope) mentioned this issue  Jul 31,
2023


##  Use saved searches to filter your results more quickly


Yeah, that's correct. The command I gave you only downgraded rviz_rendering,
which is the only thing that changed between 11.2.4 and 11.2.5. It should
still run.


[ ![@SheaFixstars](https://avatars.githubusercontent.com/u/66436076?s=80&v=4)
](/SheaFixstars)


    glxinfo | grep "profile version"
        Max core profile version: 4.5
        Max compat profile version: 4.5
        Max GLES1 profile version: 1.1
        Max GLES[23] profile version: 3.2
    OpenGL core profile version string: 4.5 (Core Profile) Mesa 22.2.5
    OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.2.5


Skip to content


Edit: more details on my setup: Windows 10, WSL Ubuntu 20.0.4, Docker
container with Ubuntu 22.04.1 LTS
Rviz 11.2.5 is working when I install it directly on my WSL distro.


[
![@VRichardJP](https://avatars.githubusercontent.com/u/18645627?s=80&u=18e9a7e8c90b864fe3a73b283a4081a37cfdbf9a&v=4)
](/VRichardJP)


Copy link


docker run --rm --network=host -e DISPLAY -e XAUTHORITY=/tmp/.Xauthority -v ~/.Xauthority:/tmp/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix osrf/ros:humble-desktop /bin/bash -c "apt update && apt install -y software-properties-common && add-apt-repository ppa:kisak/kisak-mesa && apt upgrade -y && rviz2"


Trying [ @gatboccia ](https://github.com/gatboccia) 's suggestion does display
various parts of the grid sometimes, but there is a weird persistent effect
where the lines and points draw over each other.
[ ![image](https://user-
images.githubusercontent.com/17211063/162647037-d2efe829-2796-4246-a001-17501cd8e7bd.png)
](https://user-
images.githubusercontent.com/17211063/162647037-d2efe829-2796-4246-a001-17501cd8e7bd.png)

---

All reactions


[ ![@Robeatrice](https://avatars.githubusercontent.com/u/149628653?s=40&v=4)
](/Robeatrice) [ Robeatrice ](/Robeatrice) mentioned this issue  Nov 1, 2023


###  Footer navigation


[
![@JensVanhooydonck](https://avatars.githubusercontent.com/u/5812950?s=80&u=9f6c6f361e6bd6a54941fc83a75795b1c10d97f7&v=4)
](/JensVanhooydonck)


The only change between 11.2.4 and 11.2.5 of consequence was [ #931
](https://github.com/ros2/rviz/pull/931) . While I guess that could cause
problems, it seems unlikely that this is causing this particular problem.


You can’t perform that action at this time.


[
![@trishmapow](https://avatars.githubusercontent.com/u/17211063?s=80&u=03d434d5be14c18d172b97e122025705a4187017&v=4)
](/trishmapow)


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


Toggle navigation


> I also had this problem with windows 10 enterprise, docker-desktop and
> Ubuntu 22.04 LTS. I was able to fix this issue by upgrading the mesa package
> with the binaries provided by the kisak/kisak-mesa ppa:
>


  * cmake
  * python3-dir
  * python3native
  * ros2_distro
  * ros_ament_cmake
  * ros_component
  * ros_distro
  * ros_distro_humble
  * ros_faulty_solibs
  * ros_superflore_generated


Sorry, something went wrong.


Closed


    $ sudo apt list --installed | grep rviz

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

    ros-humble-rviz-assimp-vendor/jammy,now 11.2.5-1jammy.20230112.141217 amd64 [installed,automatic]
    ros-humble-rviz-common/jammy,now 11.2.5-1jammy.20230120.222053 amd64 [installed,automatic]
    ros-humble-rviz-default-plugins/jammy,now 11.2.5-1jammy.20230124.071257 amd64 [installed,automatic]
    ros-humble-rviz-ogre-vendor/jammy,now 11.2.5-1jammy.20230112.141237 amd64 [installed,automatic]
    ros-humble-rviz-rendering/jammy,now 11.2.5-1jammy.20230112.145716 amd64 [installed,automatic]
    ros-humble-rviz2/jammy,now 11.2.5-1jammy.20230124.081000 amd64 [installed,automatic]


Pick a username


[ rviz black screen  zeal-up/Simple-LIO-SAM#5  ](/zeal-up/Simple-LIO-
SAM/issues/5)


Full log with ` -l ` below:


> Since this is a custom URDF, there's no package name,


Everytime I try to do this, I get an error like this


[ Using MoveIt with ROS-I
](http://wiki.ros.org/Industrial/Tutorials/Create_a_MoveIt_Pkg_for_an_Industrial_Robot)


Built with [ Sphinx ](http://sphinx-doc.org/) using a [ theme
](https://github.com/rtfd/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .


> Should I make a workspace with these files in /src? And should i then
> rebuild and source the setup files of this workspace?


##  Further Information and Resources  ¶


On Read the Docs


#  Build a MoveIt! Package  ¶


I don't understand this.


3 Use Moveit:
RVIZ has been open: you can see that a MotionPlanning plugin has been launched. First check the box "Allow approximate IK Solutions" on the bottom of the left control panel. Then, go to the Planning tab.


  1. Create a ` controllers.yaml  ` file ( ` myworkcell_moveit_config/config/controllers.yaml  ` ) with the following contents:

        controller_list:
      - name: ""
        action_ns: joint_trajectory_action
        type: FollowJointTrajectory
        joints: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]


If i run ` roslaunch manip_moveit_config demo.launch ` I getthis


    ... logging to /home/tarang/.ros/log/4bbd5ee2-924a-11e6-9522-4ceb427f02d3/roslaunch-HP-dv6-19948.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.

    Invalid <arg> tag: manip_moveit_config
    ROS path [0]=/opt/ros/indigo/share/ros
    ROS path [1]=/home/tarang/ros_try/urdftry/robotis_try/catkin_Ws/src
    ROS path [2]=/opt/ros/indigo/share
    ROS path [3]=/opt/ros/indigo/stacks.

    Arg xml is <arg default="$(find manip_moveit_config)/default_warehouse_mongo_db" name="db_path"/>
    The traceback for the exception was written to the log file


edit


##  Using MoveIt! with Physical Hardware  ¶


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=32&d=identicon&r=PG)
](/users/27290/t27/)


[ ![](../../_static/footer.jpg) ](http://rosindustrial.org/ric)


[ MoveIt Setup Assistant, virtual joint crashes ](/question/361775/moveit-
setup-assistant-virtual-joint-crashes/)


> Don’t worry about learning how to use RViz to move the robot; that’s what
> we’ll cover in the next session!


##  Scan-N-Plan Application: Problem Statement  ¶


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=16&d=identicon&r=PG)
](/users/27290/t27/) [ t27 ](/users/27290/t27/) (  2016-10-15 04:16:51 -0500
)  edit


Setting up ``ros2_control`` for trajectory execution
----------------------------------------------------


> Also before running the launch file, I had to ensure ` roscore ` is
> running(I'd got stuck once, because it wasn't running)


1. Compile the packages
nao_moveit_config package doesn't need any compilation so running rospack profile should be enough


* make sure to create the package inside your ` catkin_ws/src  ` directory


  * [ Exercise 2.0 - Services ](../session2/Services.html)
  * [ Exercise 2.1 - Actions ](../session2/Actions.html)
  * [ Exercise 2.2 - Launch Files ](../session2/Launch-Files.html)
  * [ Exercise 2.3 - Parameters ](../session2/Parameters.html)


The MSA tries to automatically resolve in which package the urdf lives. That
is why you didn't need to supply it with a package name.


export NAO_IP=<YOUR_ROBOT_IP>
Launch the DCM bringup:


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=16&d=identicon&r=PG)
](/users/27290/t27/) [ t27 ](/users/27290/t27/) (  2016-10-24 15:51:10 -0500
)  edit


Seen: **2,352 times**


[ **updated 2016-10-25 01:16:18 -0500  ** ](/answers/245761/revisions/)


[ Moveit! for combining multiple robots ](/question/417417/moveit-for-
combining-multiple-robots/)


  * [ Docs ](../../index.html) »
  * Build a MoveIt! Package
  * [ Edit on GitHub ](https://github.com/ros-industrial/industrial_training/blob/melodic/gh_pages/_source/session3/Build-a-Moveit!-Package.md)


MoveIt requires several configuration parameters to include the robot description and semantic description files (:ref:`URDF and SRDF`), motion planning and kinematics plugins, trajectory execution, and more.
These parameters are usually contained in a :ref:`MoveIt Configuration` package.


[ Hi there! Please sign in ](/account/signin/?next=/question/245740/error-
while-launching-demolaunch-in-custom-moveit-config/) [ help ](/help/ "help")


roslaunch nao_moveit_config moveit_planner.launch
On a simulated robot (in Gazebo) ------------------------------To use MoveIt! with Gazebo simulation, you need: - nao_dcm_bringup (https://github.com/ros-aldebaran/nao_dcm_robot) - nao_control (https://github.com/ros-aldebaran/nao_virtual) - nao_gazebo_plugin (https://github.com/ros-aldebaran/nao_virtual)


As discussed in the :ref:`Quickstart in RViz` tutorial, you can visualize your robot model and perform motion planning tasks using RViz.


7. Generate a new package and name it ` myworkcell_moveit_config  ` .


##  Stats


Loading the MoveIt Configuration
--------------------------------


Hm. The MSA should have generated a complete ROS package for you. If that was
not the case, then it'd be nice if you could report that at [ ros-
planning/moveit/issues ](https://github.com/ros-planning/moveit/issues) .


[ Ik fast or any kinematics for my urdf file ](/question/297794/ik-fast-or-
any-kinematics-for-my-urdf-file/)


.. code-block:: python


We have posted [ this question ](https://github.com/ros-
planning/moveit2/issues/1811) to ask how this can be set without hardcoding it
using the new config load param system, but I'll consider this as answered not
to extend more.
If someone comes across this, just let you know that it was solved by two
things:
  1. adding before each launch file command in the shell:
` export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp `
  2. Modified this file so that we set ` use_sim_time ` to True ( only applicable obviously to simulation ): [ launches.py ](https://github.com/TheConstructAi/moveit2/blob/humble/moveit_configs_utils/moveit_configs_utils/launches.py#L232)
Thanks again for the help [ @JafarAbdi ](https://github.com/JafarAbdi)

---

All reactions
Sorry, something went wrong.
[
![@henningkayser](https://avatars.githubusercontent.com/u/4572766?s=40&u=57f5385857b3a63598148847abc2b35f2cfe2765&v=4)
](/henningkayser) [ henningkayser ](/henningkayser) mentioned this issue  Jan
19, 2023
[ FastDDS runtime issues [Humble, Rolling]  #1874  ](/ros-
planning/moveit2/issues/1874)
Closed
[
![@henningkayser](https://avatars.githubusercontent.com/u/4572766?s=80&u=57f5385857b3a63598148847abc2b35f2cfe2765&v=4)
](/henningkayser)
Copy link
Member
###
**[ henningkayser ](/henningkayser) ** commented  Jan 19, 2023
Closing this, updates to the DDS situation will be posted to [ #1874
](https://github.com/ros-planning/moveit2/issues/1874)

---

All reactions
Sorry, something went wrong.
[
![@henningkayser](https://avatars.githubusercontent.com/u/4572766?s=40&u=57f5385857b3a63598148847abc2b35f2cfe2765&v=4)
](/henningkayser) [ henningkayser ](/henningkayser) closed this as [ completed
](/ros-


Many of the MoveIt tutorials, as well as MoveIt packages you will encounter in the wild, use ROS 2 launch files.


This tutorial walks through a typical Python launch file that sets up a working MoveIt example.
We will do this by going through our :codedir:`Getting Started tutorial launch file <tutorials/quickstart_in_rviz/launch/demo.launch.py>` in detail.


The site is read-only. Please transition to use Robotics Stack Exchange


  4. Create a new ` myworkcell_planning_execution.launch  ` (in ` myworkcell_moveit_config/launch  ` ):

        <launch>
      <!-- The planning and execution components of MoveIt! configured to run -->
      <!-- using the ROS-Industrial interface. -->

      <!-- Non-standard joint names:
           - Create a file [robot_moveit_config]/config/joint_names.yaml
               controller_joint_names: [joint_1, joint_2, ... joint_N]
           - Update with joint names for your robot (in order expected by rbt controller)
           - and uncomment the following line: -->
      <rosparam command="load" file="$(find myworkcell_moveit_config)/config/joint_names.yaml"/>

      <!-- the "sim" argument controls whether we connect to a Simulated or Real robot -->
      <!--  - if sim=false, a robot_ip argument is required -->
      <arg name="sim" default="true" />
      <arg name="robot_ip" unless="$(arg sim)" />

      <!-- load the robot_description parameter before launching ROS-I nodes -->
      <include file="$(find myworkcell_moveit_config)/launch/planning_context.launch" >
       <arg name="load_robot_description" value="true" />
      </include>

      <!-- run the robot simulator and action interface nodes -->
      <group if="$(arg sim)">
        <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />

        <!-- publish the robot state (tf transforms) -->
        <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
      </group>

      <!-- run the "real robot" interface nodes -->
      <!--   - this typically includes: robot_state, motion_interface, and joint_trajectory_action nodes -->
      <!--   - replace these calls with appropriate robot-specific calls or launch files -->
      <group unless="$(arg sim)">
        <remap from="follow_joint_trajectory" to="joint_trajectory_action"/>
        <include file="$(find ur_modern_driver)/launch/ur_common.launch" >
          <arg name="robot_ip" value="$(arg robot_ip)"/>
          <arg name="min_payload" value="0.0"/>
          <arg name="max_payload" value="5.0"/>


##  Question Tools


Skip to content
ros-naoqi
/
nao_moveit_config


6. Enter author / maintainer info.


  * [ Exercise 3.0 - Intro to URDF ](Intro-to-URDF.html)
  * [ Exercise 3.1 - Workcell XACRO ](Workcell-XACRO.html)
  * [ Exercise 3.2 - Transforms using TF ](Coordinate-Transforms-using-TF.html)
  * Exercise 3.3 - Build a MoveIt! Package
    * Motivation
    * Reference Example
    * Further Information and Resources
    * Scan-N-Plan Application: Problem Statement
    * Scan-N-Plan Application: Guidance
    * Using MoveIt! with Physical Hardware
  * [ Exercise 3.4 - Motion Planning using RViz ](Motion-Planning-RVIZ.html)


image


_Yes, it’s required, but doesn’t have to be valid_


[ gvdhoorn ](/users/5184/gvdhoorn/)
86574  ●  283  ●  1432  ●  1054  [ http://cor.tudelft.nl/
](http://cor.tudelft.nl/ "gvdhoorn's website is http://cor.tudelft.nl/")


[ Powered by Askbot version 0.10.2 ](http://askbot.com)


  1. A new package called ` myworkcell_moveit_config  `
  2. A moveit configuration with one group (”manipulator”), that consists of the kinematic chain between the UR5’s ` base_link  ` and ` tool0  ` .


##  Comments


* [ Demo 2 - Descartes Planning and Execution ](../demo2/index.html)


Last updated: **Oct 25 '16**


* [ Demo 1 - Perception-Driven Manipulation ](../demo1/index.html)


  * [ Exercise 5.0 - Advanced Descartes Path Planning ](../session5/Advanced-Descartes-Path-Planning.html)
  * [ Exercise 5.1 - Building a Perception Pipeline ](../session5/Building-a-Perception-Pipeline.html)
  * [ Exercise 5.2 - Introduction to STOMP ](../session5/Introduction-to-STOMP.html)
  * [ Exercise 5.3 - Simple PCL Interface for Python ](../session5/Simple-PCL-Interface-for-Python.html)
  * [ Exercise 5.4 - OpenCV Image Processing (Python) ](../session5/OpenCV-in-Python.html)


Downloads


  * [ Exercise 6.0 - Documentation Generation ](../session6/Documentation-Generation.html)
  * [ Exercise 6.1 - Unit Testing ](../session6/Unit-Testing.html)
  * [ Exercise 6.2 - Using rqt tools for Analysis ](../session6/Using-rqt-tools-for-analysis.html)
  * [ Exercise 6.3 - ROS Style Guide and ros_lint ](../session6/Style-Guide-and-ros_lint.html)
  * [ Exercise 6.4 - Introduction to ROS with Docker and Amazon Web Services (AWS) ](../session6/Docker-AWS.html)


> Yes, putting the generated folder into a package file structure (as
> mentioned [ here ](http://wiki.ros.org/ROS/Tutorials/CreatingPackage) )
> works.


[ ![gvdhoorn gravatar image](/upfiles/avatars/gvdhoorn/resized/32/4550046.png)
](/users/5184/gvdhoorn/)


[ urdf error ](/question/68032/urdf-error/)


Type / to search


     [ latest ](/en/latest/)
     [ melodic ](/en/melodic/)
     [ kinetic ](/en/kinetic/)
     [ foxy ](/en/foxy/)


Skip to content
Toggle navigation
[ ](https://github.com/)
[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fmoveit2%2Fissues%2F1810)
  * Product
    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)
Explore
    * [ All features ](/features)
    * [ Documentation  ](https://docs.github.com)
    * [ GitHub Skills  ](https://skills.github.com/)
    * [ Blog  ](https://github.blog)
  * Solutions
For
    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)
By Solution
    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)
Resources
    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)
  * Open Source
    * [ GitHub Sponsors  Fund open source developers  ](/sponsors)
    * [ The ReadME Project  GitHub community articles  ](/readme)
Repositories
    * [ Topics ](/topics)
    * [ Trending ](/trending)


    hand_controller_spawner = Node(
        package="controller_manager",
        executable="spawner",
        arguments=["robotiq_gripper_controller", "-c", "/controller_manager"],
    )


MoveIt! is a free-space motion planning framework for ROS. It’s an incredibly
useful and easy-to-use tool for planning motions between two points in space
without colliding with anything. Under the hood MoveIt is quite complicated,
but unlike most ROS libraries, it has a really nice GUI Wizard to get you
going.


1 follower


Edit:


Select which part of the robot you want to move: In the plugin list on the upper part of the left column, you can select a group under MotionPlanning/Planning Request/Planning Group


"custom" urdfs should still be stored in a ROS package.


# ... all our other code goes here


.. code-block:: python


    cd ~/ros2_ws
    source install/setup.bash
    ros2 launch panda_robot_bringup start_world.launch.py

    cd ~/ros2_ws
    source install/setup.bash
    ros2 launch panda_robot_bringup panda_robot.launch.py

    cd ~/ros2_ws
    source install/setup.bash
    ros2 launch panda_robot_bringup start_control.launch.py

    cd ~/ros2_ws
    source install/setup.bash
    ros2 launch my_panda_moveit_config move_group.launch.py

    cd ~/ros2_ws
    source install/setup.bash
    ros2 launch my_panda_moveit_config moveit_rviz.launch.py

###  Expected behaviour
It should be able to plan an execute every time you launch the same launches.
###  Actual behaviour
It "randomly " fails the execute fase.
###  Backtrace or Console output
When it doesn't work, no error appears just no moving arrows appear in RVIZ
[ ![error](https://user-
images.githubusercontent.com/80715513/207838102-b08a32fc-41cc-4d99-9835-f8ca8925edee.png)
](https://user-
images.githubusercontent.com/80715513/207838102-b08a32fc-41cc-4d99-9835-f8ca8925edee.png)
When it the arrows appear:
[ ![working](https://user-
images.githubusercontent.com/80715513/207838110-0471445c-458f-4c13-8899-d6601d7d1560.png)
](https://user-
images.githubusercontent.com/80715513/207838110-0471445c-458f-4c13-8899-d6601d7d1560.png)
I made it appear the arrows by executing:

    ros2 daemon stop
    ros2 daemon start


[ ALL ](/questions/scope:all/sort:activity-desc/page:1/) [ UNANSWERED
](/questions/scope:unanswered/sort:answers-asc/page:1/)


* A static transform between the ``world`` frame and the base frame of our robot description, ``base_link``.
* A `robot state publisher <https://github.com/ros/robot_state_publisher>`_ node that listens to the robot's joint states, calculates frame transforms using the robot's URDF model, and publishes them to ``tf2``.


NOTE: The start state is not updated automatically, you have to go to 'Select Start State' select 'Current' and click 'Update'.


The urdf used for the generation of the configuration files is at: https://github.com/ros-naoqi/nao_robot


Essentially, MoveIt can publish a ROS message that defines a trajectory (joint
positions over time), but it doesn’t know how to pass that trajectory to your
hardware.


I have generated a moveit configuration from a custom URDF using the MoveIt
Setup assistant and this
tutorial(http://wiki.ros.org/Industrial/Tutorials/Create_a_MoveIt_Pkg_for_an_Industrial_Robot).
I have been able to generate all the files in the config and launch folders as
well. But, the problem occurs when I try to launch the demo.launch file using
roslaunch.


[ Next  ](Motion-Planning-RVIZ.html "Motion Planning using RViz") [ Previous
](Coordinate-Transforms-using-TF.html "Coordinate Tranforms using TF")


  2. Create the ` joint_names.yaml  ` file ( ` myworkcell_moveit_config/config/joint_names.yaml  ` ):

        controller_joint_names: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]


  3. Fill in the existing, but blank, controller_manager launch file ( ` myworkcell_moveit_config/launch/myworkcell_moveit_controller_manager.launch.xml  ` ):

        <launch>
      <arg name="moveit_controller_manager"
           default="moveit_simple_controller_manager/MoveItSimpleControllerManager"/>
      <param name="moveit_controller_manager"
             value="$(arg moveit_controller_manager)"/>

      <rosparam file="$(find myworkcell_moveit_config)/config/controllers.yaml"/>
    </launch>


catkin_make
And your ready to play with your nao


First time here? Check out the FAQ!


    # Launch RViz
    rviz_node = Node(
        package="rviz2",
        executable="rviz2",
        name="rviz2",
        output="log",
        arguments=["-d", rviz_config],
        parameters=[
            moveit_config.robot_description,
            moveit_config.robot_description_semantic,
            moveit_config.robot_description_kinematics,
            moveit_config.planning_pipelines,
            moveit_config.joint_limits,
        ],
    )


[ about ](/about/) |  [ faq ](/faq/) |  [ help ](/help/ "help") |  [ privacy
policy ](/privacy/) |  [ terms of service ](/terms/)


##  Related questions


MoveIt normally generates joint trajectories that can then be executed by sending them to a robot with a controller capable of executing these trajectories.
Most commonly, we connect to the `ros2_control <https://control.ros.org/master/index.html>`_ library to achieve this.


roslaunch manip_moveit_config demo.launch


Now you can define your motion by drag and dropping the interactive markers. You can compute a trajectory by clicking the 'planning' button Once the motion is satisfying you can try it on your real robot using 'execute' or 'plan and execute'.


Follow


[ Industrial Training ](../../index.html)


[ Moveit can't execute a plan with MoveGroupInterface
](/question/350513/moveit-cant-execute-a-plan-with-movegroupinterface/)


  * Loads your workspace description to the parameter server.
  * Starts a node ` move_group  ` that offers a suite of ROS services & actions for doing kinematics, motion planning, and more.
  * An internal simulator that publishes the last planned path on a loop for other tools (like RViz) to visualize.


ROS Resources: [ Documentation ](http://wiki.ros.org/) | [ Support
](http://wiki.ros.org/Support) | [ Discussion Forum
](http://discourse.ros.org/) | [ Index ](http://index.ros.org/) | [ Service
Status ](http://status.ros.org/) | [ ros @ Robotics Stack Exchange
](https://robotics.stackexchange.com/questions/tagged/ros)
---

_Attention:_ Answers.ros.org is deprecated as of August the 11th, 2023. Please
visit [ robotics.stackexchange.com ](http://robotics.stackexchange.com) to ask
a new question. This site will remain online in read-only mode during the
transition and into the foreseeable future. Selected questions and answers
have been migrated, and redirects have been put in place to direct users to
the corresponding questions on Robotics Stack Exchange. Additional details are
[ available here ](https://discourse.ros.org/t/ros-and-gazebo-answers-
migration-to-robotics-stack-exchange-process/31494) .


[ Problems with moveit. Exit code -11 ](/question/193137/problems-with-moveit-
exit-code-11/)


URDF and Textures used
This moveit package is based on a textured nao: https://github.com/ros-naoqi/nao_meshes


Possible confusion, but shouldn't demo.launch be in the ROS package
manip_moveit_config?


That "set of files into a configured folder" is really a ROS package.


[ ![](../../_static/logo.jpg) ](http://rosindustrial.org)


    2. Add a fixed virtual base joint. e.g.

                name = 'FixedBase' (arbitrary)
        child = 'world' (should match the URDF root link)
        parent = 'world' (reference frame used for motion planning)
        type = 'fixed'


Then you can run the usual


As such, our launch file includes nodes that publish both fixed (static) and dynamic names to ``tf2``.
In our case, we need:


from moveit_configs_utils import MoveItConfigsBuilder


Visualizing with RViz
---------------------


Finally, we can tell our launch file to actually launch everything we described in the previous sections.


add a comment


The following code uses a launch argument to receive an RViz configuration file name, packages it up as a relative path to a known package directory, and specifies it as an argument when launching the RViz executable.


By custom urdf, I mean I have a urdf file which I imported to the MSA(It didnt
need any package name). Now the MSA generates a set of files into a configured
folder with the CMakelists and package files I used the folder name `
manip_moveit_config ` . Should I make a workspace with these files in /src?


Publishing Transforms to ``tf2``
--------------------------------


[ ![JoshMarino gravatar
image](//www.gravatar.com/avatar/6eb5aabf0a37e1dc0d4ce9bc1866f574?s=16&d=identicon&r=PG)
](/users/27952/joshmarino/) [ JoshMarino ](/users/27952/joshmarino/) (
2016-10-15 11:15:05 -0500  )  edit


If you are unfamiliar with launch files in general, refer first to `the ROS 2 documentation <https://docs.ros.org/en/rolling/Tutorials/Intermediate/Launch/Creating-Launch-Files.html>`_.


[ **answered 2016-10-15 05:59:02 -0500  ** ](/answers/245761/revisions/)


  * [ Exercise 4.0 - Motion Planning using C++ ](../session4/Motion-Planning-CPP.html)
  * [ Exercise 4.1 - Intro to Descartes ](../session4/Descartes-Path-Planning.html)
  * [ Exercise 4.2 - Intro to Perception ](../session4/Introduction-to-Perception.html)


##  Scan-N-Plan Application: Guidance  ¶


|  [ Ask Your Question ](/questions/ask/)
---|---|---|---

0


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=16&d=identicon&r=PG)
](/users/27290/t27/) [ t27 ](/users/27290/t27/) (  2016-10-15 06:46:43 -0500
)  edit


2. Run MoveIt
Without a robot -------------You can run this moveit package either unconnected to any robot or attached to a robot (real or simulated): For a standalone execution :


  * [ Exercise 0.1 - Intro to Ubuntu GUI ](../prerequisites/Navigating-the-Ubuntu-GUI.html)
  * [ Exercise 0.2 - The Linux File System ](../prerequisites/Exploring-the-Linux-File-System.html)
  * [ Exercise 0.3 - Using the Terminal ](../prerequisites/The-Linux-Terminal.html)


Starting ``ros2_control`` involves launching a controller manager node, and then spawning a list of controllers necessary for trajectory execution.
In our example, we have:


Yes, putting the generated folder into a package file structure (as mentioned
[ here ](http://wiki.ros.org/ROS/Tutorials/CreatingPackage) ) works. Also
before running the launch file, I had to ensure ` roscore ` is running(I'd got
stuck once, because it wasn't running) Thanks!


##  1  Answer


If you use ` roslaunch ` to start a launch file, starting ` roscore ` should
be done automatically. Again, if that is not the case for you, that would seem
to be a problem, and it'd be appreciated if you could report that.


5. Don’t worry about adding end effectors/grippers or passive joints for this exercise.


About
MoveIt! config files for the Aldebaran NAO


3. Add a planning group called ` manipulator  ` that names the kinematic chain between ` base_link  ` and ` tool0  ` . Note: Follow [ ROS naming guidelines/requirements ](http://wiki.ros.org/ROS/Patterns/Conventions) and don’t use any whitespace, anywhere.


[ ![ gravatar image]() ]() [ ]() (  2024-04-18 13:06:44 -0500  )  edit


  1. Start the MoveIt! Setup Assistant (don’t forget auto-complete with tab):

        roslaunch moveit_setup_assistant setup_assistant.launch


    from launch.actions import DeclareLaunchArgument
    from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
    from launch_ros.substitutions import FindPackageShare


    > roslaunch manip_moveit_config demo.launch
    [demo.launch] is neither a launch file in package [manip_moveit_config] nor is [manip_moveit_config] a launch file name
    The traceback for the exception was written to the log file


    run_move_group_node = Node(
        package="moveit_ros_move_group",
        executable="move_group",
        output="screen",
        parameters=[moveit_config.to_dict()],
    )


[ __ ](/questions/) |


roslaunch manip_moveit_config demo.launch


A handy way to refer to a MoveIt configuration package is to use the ``MoveItConfigsBuilder`` utility in your Python launch files as follows:


* [ Demo 3 - Optimization Based Path Planning ](../demo3/index.html)


Please note: ROS Answers requires javascript to work properly, please enable
javascript in your browser, [ here is how
](https://www.google.com/support/bin/answer.py?answer=23852)


**[ JafarAbdi ](/JafarAbdi) ** commented  Dec 15, 2022
Have you tried switching the rmw to cyclonedds? There's a bug in fastdds not
working well with callback groups [ see ](https://github.com/ros-
planning/moveit2_tutorials/pull/519)

---

All reactions
Sorry, something went wrong.
[
![@TheConstructAi](https://avatars.githubusercontent.com/u/80715513?s=80&u=0086e3dca53758236a47b310ef33222ebaa05ad0&v=4)
](/TheConstructAi)
Copy link
Author
###
**[ TheConstructAi ](/TheConstructAi) ** commented  Dec 15, 2022
Wow, need to run more tests but the results are promising.
This dds issue seems its affecting everywhere in Humble packages.
We will repost and set the issue solved when we finish my tests, but anyway
thanks for the hint [ @JafarAbdi ](https://github.com/JafarAbdi) ;)

---

👍  1  JafarAbdi reacted with thumbs up emoji
All reactions
  * 👍  1 reaction
Sorry, something went wrong.
[
![@TheConstructAi](https://avatars.githubusercontent.com/u/80715513?s=80&u=0086e3dca53758236a47b310ef33222ebaa05ad0&v=4)
](/TheConstructAi)
Copy link
Author
###
**[ TheConstructAi ](/TheConstructAi) ** commented  Dec 15, 2022  •
edited
Ok, that was part of the issue, the second part was related to the `
use_sim_time ` .
If you don't set it in this file: [ MOD for use sim time True
](https://github.com/TheConstructAi/moveit2/blob/humble/moveit_configs_utils/moveit_configs_utils/launches.py#L232)
It wont execute any trajectory.


Have you (re)built your workspace and ` source ` d the ` setup.bash ` after
you generated the package?


* [ PC Setup ](../setup/PC-Setup---ROS.html)


    # Static TF
    static_tf = Node(
        package="tf2_ros",
        executable="static_transform_publisher",
        name="static_transform_publisher",
        output="log",
        arguments=["--frame-id", "world", "--child-frame-id", "base_link"],
    )


[ A subscriber error ](/question/100871/a-subscriber-error/)


* [ moveit_setup_assistant ](/questions/scope:all/sort:activity-desc/tags:moveit_setup_assistant/page:1/)


[ MoveIt’s Standard Wizard Guide
](http://docs.ros.org/kinetic/api/moveit_tutorials/html/doc/setup_assistant/setup_assistant_tutorial.html)


        </include>
      </group>

      <include file="$(find myworkcell_moveit_config)/launch/move_group.launch">
        <arg name="publish_monitored_planning_scene" value="true" />
      </include>

      <include file="$(find myworkcell_moveit_config)/launch/moveit_rviz.launch">
        <arg name="config" value="true"/>
      </include>

    </launch>


Code
Issues
3
Pull requests
Actions
Projects
Wiki
Security
Insights
Owner avatar
nao_moveit_config
Public
ros-naoqi/nao_moveit_config
Go to file
t
Add file
Folders and files
Name
Latest commit
mikaelarguedas
mikaelarguedas
0.0.11
65b2867
 ·
8 years ago
History
config
adding RRT as default planner
8 years ago
launch
Update the execution time
8 years ago
tuto
update dead links
8 years ago
.setup_assistant
fixing the config for the most recent urdf
9 years ago
CHANGELOG.rst
0.0.11


Error while launching demo.launch in custom moveit config


    # Load the robot configuration
    moveit_config = (
        MoveItConfigsBuilder(
            "gen3", package_name="kinova_gen3_7dof_robotiq_2f_85_moveit_config"
        )
        .robot_description(mappings=launch_arguments)
        .trajectory_execution(file_path="config/moveit_controllers.yaml")
        .planning_scene_monitor(
            publish_robot_description=True, publish_robot_description_semantic=True
        )
        .planning_pipelines(
            pipelines=["ompl", "stomp", "pilz_industrial_motion_planner"]
        )
        .to_moveit_configs()
    )


[ ROS-Industrial Website ](http://rosindustrial.org) | [ Blog
](http://rosindustrial.org/news)


from launch_ros.actions import Node


    catkin build
    source ~/catkin_ws/devel/setup.bash
    roslaunch myworkcell_moveit_config demo.launch


    arm_controller_spawner = Node(
        package="controller_manager",
        executable="spawner",
        arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
    )


3. Work your way through the tabs on the left from the top down.


Many tools in the ROS ecosystem use the `tf2 <https://docs.ros.org/en/rolling/Concepts/Intermediate/About-Tf2.html>`_ library to represent coordinate transforms, which are an important part of motion planning with MoveIt.


[ none ](/questions/scope:all/sort:activity-desc/tags:none/page:1/) ×


https://github.com/ros-naoqi/nao_robot/tree/master/nao_description or from the binary package : ros-indigo-nao-description


To do this, we need to define a few extra files.


© Copyright 2017, ROS-Industrial  Revision ` 1f327dee ` .


Or are you saying that your urdf is stored in your home directory, or at the
root of your workspace, without any package(s) at all?


[ t27 ](/users/27290/t27/)
68  ●  5  ●  8  ●  13


  * [ MIT Introduction to C++ ](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-096-introduction-to-c-january-iap-2011/assignments/)
  * [ Bruce Eckel Thinking in C++ ](http://mindview.net/Books/TICPP/ThinkingInCPP2e.html)


    ros2_controllers_path = os.path.join(
        get_package_share_directory("kinova_gen3_7dof_robotiq_2f_85_moveit_config"),
        "config",
        "ros2_controllers.yaml",
    )
    ros2_control_node = Node(
        package="controller_manager",
        executable="ros2_control_node",
        parameters=[ros2_controllers_path],
        remappings=[
            ("/controller_manager/robot_description", "/robot_description"),
        ],
        output="both",
    )


What am I missing here? Do I need to perform any other steps(besides those
mentioned in the tutorial) to get it to work?


Read the Docs  v: melodic


  5. Now let’s test the new launch files we created:

        roslaunch myworkcell_moveit_config myworkcell_planning_execution.launch


    joint_state_broadcaster_spawner = Node(
        package="controller_manager",
        executable="spawner",
        arguments=[
            "joint_state_broadcaster",
            "--controller-manager",
            "/controller_manager",
        ],
    )


2. Select “Create New MoveIt Configuration Package”, select the ` workcell.xacro  ` you created previously, then “Load File”.


roslaunch nao_moveit_config demo.launch
Once launching the demo, you should see the robot in MoveIt! GUI like this:


[ bug  ](/ros-planning/moveit2/labels/bug) Something isn't working
##  Comments
[
![@TheConstructAi](https://avatars.githubusercontent.com/u/80715513?s=80&u=0086e3dca53758236a47b310ef33222ebaa05ad0&v=4)
](/TheConstructAi)
Copy link
###
**[ TheConstructAi ](/TheConstructAi) ** commented  Dec 15, 2022
###  Description
We are getting this issue where sometimes when running moveit2 demo launch in
a simulation , sometimes the execution fails and sometimes it doesn't. It
changes each time we launch the launch files.
We are getting as working this:
[rviz2-4] [WARN] [1671098946.071992980]
[moveit_ros.planning_scene_monitor.planning_scene_monitor]: Maybe failed to
update robot state, time diff: 1671098872.983s
But its always there, when it fails the execution and when it doesn't, so not
sure is siignificative.
We suspect that it might have an effect not setting the ` use_sim_time ` . How
can this be set with the new way in humble of loading config parameters? In
which file we have to put it?
###  Your environment
  * ROS Distro: HUMBLE
  * OS Version: e.g. Ubuntu 22.04
  * Source or Binary build? Source
  * If source, which branch? humble release
###  Steps to reproduce
Launch a simulation of a robot arm an then the demo.launch.py form moveit.
Source code: [
https://bitbucket.org/theconstructcore/panda_simulation/src/master/
](https://bitbucket.org/theconstructcore/panda_simulation/src/master/)
ROSject PLug and play with all the code and instructions to launch it in
notebook: [ https://app.theconstructsim.com/l/537b5a08/
](https://app.theconstructsim.com/l/537b5a08/)
Launch the following:

    cd
    ./setup_moveit.sh


And should i then rebuild and ` source ` the setup files of this workspace?


roslaunch nao_dcm_bringup nao_dcm_H25_bringup_remote.launch
Wait until it is ready, then run:


Thats the problem, I havent generated a package. Its only a folder where the
moveit setup assistant exported the config files. Although the folder does
have a CMakeLists and a package.xml file. How do i convert this file structure
to a Ros "package"? cant I directly run a launch file?


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=16&d=identicon&r=PG)
](/users/27290/t27/) [ t27 ](/users/27290/t27/) (  2016-10-15 06:46:07 -0500
)  edit


Finally, start MoveIt!:


The outcome of these steps will be a new package that contains a large number
of launch and configuration files. At this point, it’s possible to do motion
planning, but not to execute the plan on any robot. To try out your new
configuration:


Versions


roslaunch nao_gazebo_plugin nao_gazebo_plugin_H25.launch
Wait until it is ready, then click on the Play button in Gazebo.


[ ![JoshMarino gravatar
image](//www.gravatar.com/avatar/6eb5aabf0a37e1dc0d4ce9bc1866f574?s=16&d=identicon&r=PG)
](/users/27952/joshmarino/) [ JoshMarino ](/users/27952/joshmarino/) (
2016-10-14 23:54:51 -0500  )  edit


__ [ Industrial Training ](../../index.html)


    * [ Collections ](/collections)
  * [ Pricing ](/pricing)
Search or jump to...
#  Search code, repositories, users, issues, pull requests...
Search
Clear
[ Search syntax tips ](https://docs.github.com/search-github/github-code-
search/understanding-github-code-search-syntax)
#  Provide feedback
We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel  Submit feedback
#  Saved searches
##  Use saved searches to filter your results more quickly
Name
Query
To see all available qualifiers, see our [ documentation
](https://docs.github.com/search-github/github-code-search/understanding-
github-code-search-syntax) .
Cancel  Create saved search
[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fmoveit2%2Fissues%2F1810)
[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-
name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-
repo&source_repo=ros-planning%2Fmoveit2)
You signed in with another tab or window. [ Reload ]() to refresh your
session.  You signed out in another tab or window. [ Reload ]() to refresh
your session.  You switched accounts on another tab or window. [ Reload ]() to
refresh your session.  Dismiss alert
{{ message }}
[ ros-planning ](/ros-planning) /  **[ moveit2 ](/ros-planning/moveit2) **
Public
  * [ Notifications ](/login?return_to=%2Fros-planning%2Fmoveit2)
  * [ Fork  472  ](/login?return_to=%2Fros-planning%2Fmoveit2)
  * [ Star  912  ](/login?return_to=%2Fros-planning%2Fmoveit2)
  * [ Code  ](/ros-planning/moveit2)
  * [ Issues  250  ](/ros-planning/moveit2/issues)
  * [ Pull requests  47  ](/ros-planning/moveit2/pulls)


[ edit ](/questions/245740/edit/) [ retag ](/s/questions/245740/retag/) flag
offensive  [ close ](/questions/245740/close/) merge  delete


8 years ago
CMakeLists.txt
install the .setup_assistant file for potential introspection
9 years ago
README.rst
Update README.rst
8 years ago
package.xml
0.0.11
8 years ago
Repository files navigation
README
nao_moveit_config
This is a MoveIt! config package generated by the MoveIt! wizard. It requires a NAO model which you can get from here:


melodic


> In this exercise, we will create a MoveIt! package for an industrial robot.
> This package creates the configuration and launch files required to use a
> robot with the MoveIt! Motion-Control nodes. In general, the MoveIt! package
> does not contain any C++ code.


##  Motivation  ¶


The MSA generates regular ROS packages, so you should be able to launch them
using


Don't know if this makes any sense?
I this resetting some parameters?
Does anyone know what could this be?
Because even when the arrows appear, it fails to execute, giving the error:

    [move_group-1] [WARN] [1671100824.609050047] [moveit_ros.trajectory_execution_manager]: Failed to validate trajectory: couldn't receive full current jointstate within 1s
    [move_group-1] [INFO] [1671100824.609181350] [moveit_move_group_default_capabilities.move_action_capability]: Solution found but controller failed during execution

    [rviz2-1] [INFO] [1671100822.549907729] [move_group_interface]: Plan and Execute request accepted
    [rviz2-1] [INFO] [1671100824.609950500] [move_group_interface]: Plan and Execute request aborted
    [rviz2-1] [ERROR] [1671100824.651578494] [move_group_interface]: MoveGroupInterface::move() failed or timeout reached
    [rviz2-1] [WARN] [1671100825.316650945] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Maybe failed to update robot state, time diff: 1671100373.464s

And when we try to do a dump of the parameters it gives this error:
` ros2 param dump /move_group `
Traceback (most recent call last):
File "/opt/ros/humble/local/lib/python3.10/dist-
packages/rcl_interfaces/msg/_parameter_value.py", line 225, in double_value
assert value >= -1.7976931348623157e+308 and value <= 1.7976931348623157e+308,
AssertionError: The 'double_value' field must be a double in
[-1.7976931348623157e+308, 1.7976931348623157e+308]

---

The text was updated successfully, but these errors were encountered:

All reactions
[
![@TheConstructAi](https://avatars.githubusercontent.com/u/80715513?s=40&u=0086e3dca53758236a47b310ef33222ebaa05ad0&v=4)
](/TheConstructAi) [ TheConstructAi ](/TheConstructAi) added the [ bug ](/ros-
planning/moveit2/labels/bug) Something isn't working  label  Dec 15, 2022
[
![@JafarAbdi](https://avatars.githubusercontent.com/u/16278108?s=80&u=e2772099cfb31f3e0d03dfc8237aac48213b1924&v=4)
](/JafarAbdi)
Copy link
Member
###


##  Comments


[ tags ](/tags/) [ users ](/users/) [ badges ](/badges/)


  * [ Exercise 7.0 - ROS2 basics ](../session7/ROS2-Basics.html)
  * [ Exercise 7.1 - ROS1 to ROS2 porting ](../session7/ROS1-to-ROS2-porting.html)
  * [ Exercise 7.2 - Using the ROS1-ROS2 bridge ](../session7/ROS1-ROS2-bridge.html)


MoveIt!’s setup assistant generates a suite of files that, upon launch:


First, set NAO_IP environment variable to your robot's IP address:


[ Reusing MoveIt configuration package or not? ](/question/386473/reusing-
moveit-configuration-package-or-not/)


> By custom urdf, I mean I have a urdf file which I imported to the MSA(It
> didnt need any package name).


Resources
 Readme
 Activity
 Custom properties
Stars
 10 stars
Watchers
 10 watching
Forks
 11 forks
Report repository
Releases
 11 tags
Packages
No packages published
Contributors
4
@mikaelarguedas
mikaelarguedas Mikael Arguedas
@vrabaud
vrabaud Vincent Rabaud
@nlyubova
nlyubova Natalia Lyubova
@costashatz
costashatz Konstantinos Chatzilygeroudis
Languages
CMake
100.0%
Footer
© 2024 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Status
Docs
Contact
Manage cookies
Do not share my personal information


[ edit ](/s/answers/245761/edit/) flag offensive  delete  [ link
](/question/245740/error-while-launching-demolaunch-in-custom-moveit-
config/?answer=245761#post-id-245761 "permanent link") more


add a comment


For the dcm and gazebo packages you need to compile the C++ nodes. In order to compile nao_dcm packages, you need to set the environment variable AL_DIR to the path to naoqiSDK-c++ on your computer.


While ``ros2_control`` allows you to connect to real robot hardware, or robots in a physics-based simulator like Gazebo or NVIDIA Isaac Sim, it also exposes a `mock components <https://control.ros.org/master/doc/ros2_control/hardware_interface/doc/mock_components_userdoc.html>`_ capability for simple, idealized simulations.
In our example, this is configured at the URDF level using the ``use_fake_hardware`` xacro parameter defined earlier on.
The key idea is that regardless of which hardware (simulated or real) is launched, the ``ros2_control`` launch remains the same.


Asked: ** 2016-10-14 17:09:50 -0500  **


[ Moveit with differential gear wrist ](/question/412743/moveit-with-
differential-gear-wrist/)


Launching Move Group
--------------------


Sort by »  [ oldest  ](/question/245740/error-while-launching-demolaunch-in-
custom-moveit-config/?sort=oldest#sort-top) [ newest
](/question/245740/error-while-launching-demolaunch-in-custom-moveit-
config/?sort=latest#sort-top) [ most voted  ](/question/245740/error-while-
launching-demolaunch-in-custom-moveit-config/?sort=votes#sort-top)


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=16&d=identicon&r=PG)
](/users/27290/t27/) [ t27 ](/users/27290/t27/) (  2016-10-15 03:51:27 -0500
)  edit


    # Define xacro mappings for the robot description file
    launch_arguments = {
        "robot_ip": "xxx.yyy.zzz.www",
        "use_fake_hardware": "true",
        "gripper": "robotiq_2f_85",
        "dof": "7",
    }


##  Reference Example  ¶


roslaunch nao_moveit_config moveit_planner.launch
This is based on the work of Konstantinos Chatzilygeroudis: https://github.com/costashatz/nao_dcm.


1. Generate a self-collision matrix.


Edit:


# ... all our imports go here


* A joint state broadcaster, which publishes the joint states necessary for the robot state publisher to send frames to ``tf2``.
* A joint trajectory controller for the arm actuators.
* A gripper action controller for the parallel-jaw gripper.


[ **asked 2016-10-14 17:09:50 -0500  ** ](/questions/245740/revisions/)


Launching all the nodes
-----------------------


.. code-block:: python


` Hm. The MSA should have generated a complete ROS package for you. If that
was not the case, then it'd be nice if you could report that at ros-
planning/moveit/issues. ` MSA generates a package,I meant that I needed to
move that folder to ./src/ in my workspace and run catkin_make to make it work


Yes. Afterwards, you should be able to launch ` demo.launch ` succesfully.


     [ Project Home ](//readthedocs.org/projects/industrial-training-master/?fromdocs=industrial-training-master)
     [ Builds ](//readthedocs.org/builds/industrial-training-master/?fromdocs=industrial-training-master)


  *[
              2016-10-14 17:09:50 -0500
             ]: 2016-10-14 17:09:50 -0500
  *[
             2016-10-14 23:54:51 -0500
            ]: 2016-10-14 23:54:51 -0500
  *[
             2016-10-15 03:51:27 -0500
            ]: 2016-10-15 03:51:27 -0500
  *[
             2016-10-15 04:16:51 -0500
            ]: 2016-10-15 04:16:51 -0500
  *[
              2016-10-15 05:59:02 -0500
             ]: 2016-10-15 05:59:02 -0500
  *[
              2016-10-25 01:16:18 -0500
             ]: 2016-10-25 01:16:18 -0500
  *[
             2016-10-15 06:46:07 -0500
            ]: 2016-10-15 06:46:07 -0500
  *[
             2016-10-15 06:46:43 -0500
            ]: 2016-10-15 06:46:43 -0500
  *[
             2016-10-15 11:15:05 -0500
            ]: 2016-10-15 11:15:05 -0500
  *[
             2016-10-24 15:51:10 -0500
            ]: 2016-10-24 15:51:10 -0500
  *[
             2016-10-25 15:04:04 -0500
            ]: 2016-10-25 15:04:04 -0500
  *[
        2016-10-14 17:09:50 -0500
       ]: 2016-10-14 17:09:50 -0500
  *[
        2024-04-18 13:06:44 -0500
       ]: 2024-04-18 13:06:44 -0500


* [ moveit ](/questions/scope:all/sort:activity-desc/tags:moveit/page:1/)


Since this is a custom URDF, there's no package name, hence I simply use this
command to launch the file


On a real robot -------------To launch it on a real nao you need: - nao_dcm_bringup (https://github.com/ros-aldebaran/nao_dcm_robot) - nao_control (https://github.com/ros-aldebaran/nao_virtual)


  * [ Discussions  ](/ros-planning/moveit2/discussions)
  * [ Actions  ](/ros-planning/moveit2/actions)
  * [ Projects  1  ](/ros-planning/moveit2/projects)
  * [ Security  ](/ros-planning/moveit2/security)
  * [ Insights  ](/ros-planning/moveit2/pulse)
Additional navigation options
  * [ Code  ](/ros-planning/moveit2)
  * [ Issues  ](/ros-planning/moveit2/issues)
  * [ Pull requests  ](/ros-planning/moveit2/pulls)
  * [ Discussions  ](/ros-planning/moveit2/discussions)
  * [ Actions  ](/ros-planning/moveit2/actions)
  * [ Projects  ](/ros-planning/moveit2/projects)
  * [ Security  ](/ros-planning/moveit2/security)
  * [ Insights  ](/ros-planning/moveit2/pulse)
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.
Pick a username

Email Address

Password

Sign up for GitHub
By clicking “Sign up for GitHub”, you agree to our [ terms of service
](https://docs.github.com/terms) and [ privacy statement
](https://docs.github.com/privacy) . We’ll occasionally send you account
related emails.
Already on GitHub? [ Sign in ](/login?return_to=%2Fros-
planning%2Fmoveit2%2Fissues%2Fnew%2Fchoose) to your account
Jump to bottom
#  Inconsistency in making work moveit2 in Humble  #1810
Closed
[ TheConstructAi ](/TheConstructAi) opened this issue  Dec 15, 2022  · 4
comments
Closed
#  Inconsistency in making work moveit2 in Humble  #1810
[ TheConstructAi ](/TheConstructAi) opened this issue  Dec 15, 2022  · 4
comments
Labels


[ ![ROS Answers logo](/m/ros/media/images/logoros.png?v=28) ](/questions/)


[ ![t27 gravatar
image](//www.gravatar.com/avatar/e2b4a69fd093ef7f07f5c9ba8aa7cfce?s=16&d=identicon&r=PG)
](/users/27290/t27/) [ t27 ](/users/27290/t27/) (  2016-10-25 15:04:04 -0500
)  edit


4. Create a few named positions (e.g. “home”, “allZeros”, etc.) to test with motion-planning.


[ subscribe to rss feed ](/feeds/question/245740/ "subscribe to the rss feed")


  * [ Exercise 1.0 - ROS Setup ](../session1/ROS-Setup.html)
  * [ Exercise 1.1 - Create a Workspace ](../session1/Create-Catkin-Workspace.html)
  * [ Exercise 1.2 - Installing Packages ](../session1/Installing-Existing-Packages.html)
  * [ Exercise 1.3 - Packages and Nodes ](../session1/Creating-a-ROS-Package-and-Node.html)
  * [ Exercise 1.4 - Topics and Messages ](../session1/Topics-and-Messages.html)


    # Get the path to the RViz configuration file
    rviz_config_arg = DeclareLaunchArgument(
        "rviz_config",
        default_value="kinova_moveit_config_demo.rviz",
        description="RViz configuration file",
    )
    rviz_base = LaunchConfiguration("rviz_config")
    rviz_config = PathJoinSubstitution(
        [FindPackageShare("moveit2_tutorials"), "launch", rviz_base]
    )


Free document hosting provided by [ Read the Docs
](http://www.readthedocs.org) .


> Now the MSA generates a set of files into a configured folder with the
> CMakelists and package files I used the folder name ` manip_moveit_config `
> .


Here, ` manip_moveit_config ` is the name of the folder in which I saved my
moveit config (in the last step of the setup assistant)


.. code-block:: python


[ Take 3D self filter out of moveit! ](/question/165676/take-3d-self-filter-
out-of-moveit/)


a. Set the kinematics solver to ` KDLKinematicsPlugin  `


        return LaunchDescription(
            [
                rviz_config_arg,
                rviz_node,
                static_tf,
                robot_state_publisher,
                run_move_group_node,
                ros2_control_node,
                joint_state_broadcaster_spawner,
                arm_controller_spawner,
                hand_controller_spawner,
            ]
        )


Yes, give this a try for sure. When gvdhoorn says custom URDFs should be
stored in a ROS package, he is correct. This is because demo.launch looks for
URDF in a launch file from another ROS package. You will either have to
replace this with correct location or make a package for it (very easy).


def generate_launch_description():


Launch Files in MoveIt
======================


planning/moveit2/issues?q=is%3Aissue+is%3Aclosed+archived%3Afalse+reason%3Acompleted)
Jan 19, 2023
[ Sign up for free ](/join?source=comment-repo) **to join this conversation on
GitHub** . Already have an account? [ Sign in to comment
](/login?return_to=https%3A%2F%2Fgithub.com%2Fros-
planning%2Fmoveit2%2Fissues%2F1810)
Assignees
No one assigned
Labels
[ bug  ](/ros-planning/moveit2/labels/bug) Something isn't working
Projects
None yet
Milestone
No milestone
Development
No branches or pull requests
3 participants
[ ![@henningkayser](https://avatars.githubusercontent.com/u/4572766?s=52&v=4)
](/henningkayser) [
![@JafarAbdi](https://avatars.githubusercontent.com/u/16278108?s=52&v=4)
](/JafarAbdi) [
![@TheConstructAi](https://avatars.githubusercontent.com/u/80715513?s=52&v=4)
](/TheConstructAi)
##  Footer
[ ](https://github.com "GitHub") © 2024 GitHub, Inc.
###  Footer navigation
  * [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
  * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
  * [ Security ](/security)
  * [ Status ](https://www.githubstatus.com/)
  * [ Docs ](https://docs.github.com/)
  * [ Contact ](https://support.github.com?tags=dotcom-footer)
  * Manage cookies
  * Do not share my personal information
You can’t perform that action at this time.


roslaunch ./launch/demo.launch


In this exercise, you will generate a MoveIt package for the UR5 workcell you
built in a previous step. This process will mostly involve running the MoveIt!
Setup Assistant. At the end of the exercise you should have the following:


Launch Gazebo, like this:


[ ![cc-by-sa](/m/default/media/images/cc-by-sa.png?v=28)
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) ROS Answers is
licensed under Creative Commons Attribution 3.0 Content on this site is
licensed under a [ Creative Commons Attribution Share Alike 3.0
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) license.


* [ urdf ](/questions/scope:all/sort:activity-desc/tags:urdf/page:1/)


Once all the MoveIt configuration parameters have been loaded, you can launch the :ref:`Move Group Interface` using the entire set of loaded MoveIt parameters.


    # Publish TF
    robot_state_publisher = Node(
        package="robot_state_publisher",
        executable="robot_state_publisher",
        name="robot_state_publisher",
        output="both",
        parameters=[moveit_config.robot_description],
    )


     [ pdf ](//industrial-training-master.readthedocs.io/_/downloads/en/melodic/pdf/)
     [ html ](//industrial-training-master.readthedocs.io/_/downloads/en/melodic/htmlzip/)
     [ epub ](//industrial-training-master.readthedocs.io/_/downloads/en/melodic/epub/)


The moveit package must be run on a remote computer and not directly on your robot.


if __name__ == "__main__":
    print(html_tree("".join(sys.stdin.readlines())))
This HTML uses an embedded Google Font for a more pleasant look. The inline CSS styling removes bullet points from regular unordered lists because you use bullet points for key-value mappings. However, lists explicitly marked as sequences use a dash in front of every item. Mapping keys are displayed in bold font, and multiline strings preserve the whitespace.


Well, well, well.


The next example shows one of the standard YAML tags in action:


#  Using parameters in a class (Python)  ï


   def main():
       print("Hello world")


if isinstance(event, ScalarEvent):
            self._html.append(event.value)
        elif isinstance(event, SequenceStartEvent):
            self._html.append("
")
            self._context.append(list)
        elif isinstance(event, SequenceEndEvent):
            self._html.append("
")
            self._context.pop()
        elif isinstance(event, MappingStartEvent):
            self._html.append("
")
            self._context.append(0)
        elif isinstance(event, MappingEndEvent):
            self._html.append("
")
            self._context.pop()


Note: This implicit typing in YAML seems convenient, but it’s like playing with fire, and it can cause serious problems in edge cases. As a result, the YAML 1.2 specification dropped support for some built-in literals like yes and no.


def html_tree(stream, loader=yaml.SafeLoader):
    body = visit(yaml.compose(stream, loader))
    return (
        "<!DOCTYPE html>"
        ""
        ""
        "  <meta charset=\"utf-8\">"
        "  <title>YAML Tree Preview</title>"
        "  <link href=\"https://fonts.googleapis.com/css2"
        "?family=Roboto+Condensed&display=swap\" rel=\"stylesheet\">"
        "  "
        ""
        f"{body}"
    )


def html_list(node):
    items = "".join(f"
{visit(child)}
" for child in node.value)
    return f'
{items}
'


# models.py


Subscribe


square: &square
  a: 5


Loader Class	Function	Description
BaseLoader	-	Doesn’t resolve or support any tags and constructs only basic Python objects (str, list, dict)
Loader	-	Kept for backward compatibility but otherwise the same as UnsafeLoader
UnsafeLoader	unsafe_load()	Supports all standard, library, and custom tags and may construct an arbitrary Python object
SafeLoader	safe_load()	Supports only standard YAML tags like !!str and doesn’t construct class instances
FullLoader	full_load()	Should be able to load almost all YAML safely
The three loaders that you’re most likely to use have corresponding shorthand functions, which you can call instead of passing a loader class to the generic yaml.load() function. Remember, these are all written in Python, so for improved performance, you’ll need to import a suitable loader class prefixed with the letter C, such as CSafeLoader, and call yaml.load() anyway.


Viewing data dictionary in yaml format in the file output.yaml
Similarly, you can call the write_yaml_to_file() function with data2 as the argument to convert it to YAML and store it into a YAML file.


# Flow style:
!!python/object/apply:models.Person [John, Doe]


def dump(data, stream=None, Dumper=Dumper, **kwargs): ...
def safe_dump(data, stream=None, **kwargs): ...
def safe_dump_all(documents, stream=None, **kwargs): ...
The first function expects between one and three positional arguments since two of them have optional values. On the other hand, the second and the third function listed above expect only two positional arguments because they both use a predefined SafeDumper. To find the available keyword arguments, you have to look at the yaml.dump_all() function’s signature.


    maintainer='YourName',
    maintainer_email='you@email.com',
    description='Python parameter tutorial',
    license='Apache License 2.0',


Open a console and navigate to the root of your workspace, ` ros2_ws  ` , and
build your new package:


Note that you can use !!python/object/apply against any callable object, including regular functions, and specify the arguments to pass. This lets you execute one of the built-in functions, a custom function, or even a module-level function, which PyYAML will happily import for you. That’s a huge security hole! Imagine using the os or subprocess module to run a shell command that retrieves your private SSH key if you’ve defined one:


YAML was originally meant to simplify Extensible Markup Language (XML), but in reality, it has a lot more in common with JavaScript Object Notation (JSON). In fact, it’s a superset of JSON.


Built with [ Sphinx ](https://www.sphinx-doc.org/) using a [ theme
](https://github.com/readthedocs/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .


script.py
Copywith open(f'{filename}.yaml','r') as f:
        data = yaml.safe_load_all(f)
        loaded_data = list(data)
with open('output4.yaml', 'w') as file:
        yaml.dump_all(loaded_data,file, sort_keys=False)
print('done!')
And you have the complete function as follows:


person:
  firstName: John
  lastName: Doe
  dateOfBirth: 1969-12-31
  married: true
  spouse:
    firstName: Jane
    lastName: Smith
  children:
    - firstName: Bobby
      dateOfBirth: 1995-01-17
    - firstName: Molly
      dateOfBirth: 2001-05-14
You’ve just defined a person, John Doe, who’s married to Jane Smith and has two children, Bobby and Molly. Notice how the list of children contains anonymous objects, unlike, for example, the spouse defined under a property named "spouse". When anonymous or unnamed objects appear as list items, you can recognize them by their properties, which are aligned with an opening dash character (-).


Linux  macOS  Windows


    $ ros2 run ros2_tutorials test_params_rclpy --ros-args -p this_is_a_non_declared_param:="This will work"
    [INFO] [test_params_rclpy]: Params: 8, Is there anybody out there?, [1.1, 2.2]

    # In another terminal:
    $ ros2 param list
    /test_params_rclpy:
      this_is_a_non_declared_param
      use_sim_time
    $ ros2 param get /test_params_rclpy this_is_a_non_declared_param
    String value is: This will work


>>> import io
>>> stream = io.StringIO()
>>> print(yaml.dump(data, stream))
None


        * [ Introducing ` tf2  ` ](../Intermediate/Tf2/Introduction-To-Tf2.html)
        * [ Writing a static broadcaster (Python) ](../Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Py.html)
        * [ Writing a static broadcaster (C++) ](../Intermediate/Tf2/Writing-A-Tf2-Static-Broadcaster-Cpp.html)
        * [ Writing a broadcaster (Python) ](../Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Py.html)
        * [ Writing a broadcaster (C++) ](../Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.html)
        * [ Writing a listener (Python) ](../Intermediate/Tf2/Writing-A-Tf2-Listener-Py.html)
        * [ Writing a listener (C++) ](../Intermediate/Tf2/Writing-A-Tf2-Listener-Cpp.html)
        * [ Adding a frame (Python) ](../Intermediate/Tf2/Adding-A-Frame-Py.html)
        * [ Adding a frame (C++) ](../Intermediate/Tf2/Adding-A-Frame-Cpp.html)
        * [ Using time (Python) ](../Intermediate/Tf2/Learning-About-Tf2-And-Time-Py.html)
        * [ Using time (C++) ](../Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp.html)
        * [ Traveling in time (Python) ](../Intermediate/Tf2/Time-Travel-With-Tf2-Py.html)
        * [ Traveling in time (C++) ](../Intermediate/Tf2/Time-Travel-With-Tf2-Cpp.html)
        * [ Debugging ](../Intermediate/Tf2/Debugging-Tf2-Problems.html)
        * [ Quaternion fundamentals ](../Intermediate/Tf2/Quaternion-Fundamentals.html)
        * [ Using stamped datatypes with ` tf2_ros::MessageFilter  ` ](../Intermediate/Tf2/Using-Stamped-Datatypes-With-Tf2-Ros-MessageFilter.html)
      * [ Testing ](../Intermediate/Testing/Testing-Main.html)
        * [ Running Tests in ROS 2 from the Command Line ](../Intermediate/Testing/CLI.html)
        * [ Writing Basic Tests with C++ with GTest ](../Intermediate/Testing/Cpp.html)
        * [ Writing Basic Tests with Python ](../Intermediate/Testing/Python.html)
      * [ URDF ](../Intermediate/URDF/URDF-Main.html)
        * [ Building a visual robot model from scratch ](../Intermediate/URDF/Building-a-Visual-Robot-Model-with-URDF-from-Scratch.html)
        * [ Building a movable robot model ](../Intermediate/URDF/Building-a-Movable-Robot-Model-with-URDF.html)
        * [ Adding physical and collision properties ](../Intermediate/URDF/Adding-Physical-and-Collision-Properties-to-a-URDF-Model.html)
        * [ Using Xacro to clean up your code ](../Intermediate/URDF/Using-Xacro-to-Clean-Up-a-URDF-File.html)
        * [ Using URDF with ` robot_state_publisher  ` ](../Intermediate/URDF/Using-URDF-with-Robot-State-Publisher.html)
    * [ Advanced ](../Advanced.html)
      * [ Enabling topic statistics (C++) ](../Advanced/Topic-Statistics-Tutorial/Topic-Statistics-Tutorial.html)
      * [ Using Fast DDS Discovery Server as discovery protocol [community-contributed] ](../Advanced/Discovery-Server/Discovery-Server.html)
      * [ Implementing a custom memory allocator ](../Advanced/Allocator-Template-Tutorial.html)
      * [ Recording a bag from a node (C++) ](../Advanced/Recording-A-Bag-From-Your-Own-Node-CPP.html)
      * [ Simulators ](../Advanced/Simulators/Simulation-Main.html)
        * [ Webots ](../Advanced/Simulators/Webots/Simulation-Webots.html)
          * [ Installation (Ubuntu) ](../Advanced/Simulators/Webots/Installation-Ubuntu.html)
          * [ Installation (Windows) ](../Advanced/Simulators/Webots/Installation-Windows.html)
          * [ Installation (macOS) ](../Advanced/Simulators/Webots/Installation-MacOS.html)
          * [ Setting up a robot simulation (Basic) ](../Advanced/Simulators/Webots/Setting-Up-Simulation-Webots-Basic.html)
          * [ Setting up a robot simulation (Advanced) ](../Advanced/Simulators/Webots/Setting-Up-Simulation-Webots-Advanced.html)
        * [ Ignition ](../Advanced/Simulators/Ignition/Simulation-Ignition.html)
          * [ Setting up a robot simulation (Ignition Gazebo) ](../Advanced/Simulators/Ignition/Ignition.html)


if __name__ == "__main__":
    print(colorize("".join(sys.stdin.readlines())))
You import the sys module from Python’s standard library and pass the sys.stdin reference to the colorize() function that you just created. Now, you may run your script in the terminal and enjoy color-coded YAML tokens:


>>> SafeLoader
<class 'yaml.cyaml.CSafeLoader'>
First, you try importing one of the loader classes prefixed with the letter C to denote the use of the C library binding. If that fails, then you import a corresponding class implemented in Python. Unfortunately, this makes your code look more verbose and prevents you from using the mentioned shortcut functions.


It’s very useful, you can start your node with different settings each time,
without having to change your Python code.


**
[ ROS2 For Beginners
Learn ROS2 in 1 Week ](https://rbcknd.com/ros2-for-beginners) **


    def __init__(self):
        super().__init__('test_params_rclpy')

        self.declare_parameters(
            namespace='',
            parameters=[
                ('my_str', rclpy.Parameter.Type.STRING),
                ('my_int', rclpy.Parameter.Type.INTEGER),
                ('my_double_array', rclpy.Parameter.Type.DOUBLE_ARRAY)
            ]
        )


How Classes and Objects Work in Python
16 minute read
Learn how to work with classes and objects in Python in this tutorial. Discover how to define attributes and methods, use class variables and methods, and cr...


Geir Arne Hjelle
Geir Arne


You can also read YAML content straight from a file. Go ahead and create a file with sample YAML content in it and load it into Python using PyYAML:


To conclude on that: as a general rule, always declare your parameters first,
and follow the ROS2 way of doing things. Only allow undeclared parameters for
a good reason.


# ...
This new function iterates over a tokenized text in reverse and inserts escape code sequences where indicated by start and end. Note that it’s not the most efficient way of doing this, because you essentially end up making lots of text copies due to slicing and concatenating.


print(yaml_output)
Now, run script.py. You should see the following output:


import sys
import yaml


Mercy Bassey %
Mercy Bassey
This article explains how to manage Python YAML with PyYAML. Earthly greatly improves continuous integration workflows involving Python. Learn how.


# yaml2html.py


>>> import yaml


>>> for document in yaml.safe_load_all(stream):
...     print(document)
...
3.14
{'name': 'John Doe', 'age': 53}
['apple', 'banana', 'orange']
The individual documents must start with a triple dash (---) and can optionally end with three dots (...).


# models.py


Note: JSON is the only data format that doesn’t support comments. They were removed from the specification on purpose to simplify the parsers and prevent people from abusing them for custom processing instructions.


def process(self, event):


$ ros2 run ros2_tutorials test_params_rclpy


However, there is one case where this could lead to a problem: if, for some
reasons, your node is not aware of all parameters it should have when it is
started.


Click the collapsible section below to reveal the complete source code:


# colorize.py


new-3.png
Conclusion
In this tutorial, you’ve learned how to handle YAML using Python and the PyYAML library. You’ve worked with functions like safe_load(), safe_load_all(), dump(), and dump_all() to manipulate YAML data and even convert it to JSON with Python’s json library.


Now run the node:


[ The Robotics Back-End ](https://roboticsbackend.com/)


class HTMLBuilder:
    def __init__(self):
        self._context = []
        self._html = []


>>> yaml.safe_load("name: Иван".encode("utf-32"))
Traceback (most recent call last):
  ...
yaml.reader.ReaderError: unacceptable character #x0000:
special characters are not allowed
  in "<byte string>", position 1
If you try loading YAML from a text encoded with UTF-32, then you’ll get an error. However, that’s hardly a problem in practice because UTF-32 isn’t a common encoding. In any case, you can always do the appropriate transcoding yourself using Python’s str.encode() and str.decode() methods before loading YAML. Alternatively, you could try one of the other YAML parsing libraries mentioned earlier.


Analytics


Viewing (data2) list of dictionaries in yaml format in a file (output2.yaml)
Reading YAML in Python
The yaml module comes with a function that can be used to read YAML files. This process of YAML files with PyYAML is also referred to as loading a YAML file.


All right, that’s all when it comes to parsing YAML documents at a low level using the PyYAML library. The corresponding yaml.emit() and yaml.serialize() functions work the other way around by taking a sequence of events or the root node, respectively, and turning them into a YAML representation. But you’ll rarely need to use them.


Now that you’ve declared parameters in your code, let’s retrieve them in the
node’s code!


Dumping Python Objects to YAML Documents
If you’ve worked with JSON in Python before, then serializing or “dumping” Python objects to YAML will look more familiar than loading them. The PyYAML library has an interface that’s somewhat similar to the built-in json module. It also provides fewer dumper classes and wrapper functions than loaders to choose from, so you don’t have to juggle that many options.


Now open the ` setup.py  ` file. Add the ` import  ` statements to the top of
the file, and the other new statement to the ` data_files  ` parameter to
include all launch files:


import yaml


[ ![ROS2 For Beginners - Step by Step Course](https://roboticsbackend.com/wp-
content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
](https://rbcknd.com/ros2-for-beginners)


>>> value
ScalarNode(tag='tag:yaml.org,2002:float', value='3.14')
Because there are only three kinds of nodes (ScalarNode, SequenceNode, and MappingNode), you might automate their traversal with a recursive function:


    from rclpy.parameter import Parameter
    ...

    def __init__(self):
        super().__init__('test_params_rclpy')

        self.declare_parameter('my_str', rclpy.Parameter.Type.STRING)
        self.declare_parameter('my_int', rclpy.Parameter.Type.INTEGER)
        self.declare_parameter('my_double_array', rclpy.Parameter.Type.DOUBLE_ARRAY)

        param_str = Parameter('my_str', Parameter.Type.STRING, 'Set from code')
        param_int = Parameter('my_int', Parameter.Type.INTEGER, 12)
        param_double_array = Parameter('my_double_array', Parameter.Type.DOUBLE_ARRAY, [1.1, 2.2])

        self.set_parameters([param_str, param_int, param_double_array])


def colorize(text):
    colors = {
        yaml.KeyToken: lambda x: f"\033[34;1m{x}\033[0m",
        yaml.ValueToken: lambda x: f"\033[36m{x}\033[0m",
        yaml.TagToken: lambda x: f"\033[31m{x}\033[0m",
    }


Performance cookies are used to understand and analyze the key performance
indexes of the website which helps in delivering a better user experience for
the visitors.


Next up, you’ll learn more about dumping custom classes with PyYAML.


>>> key, value = root.value[1].value[0]


In practice, however, the two formats look different, as the YAML specification puts more emphasis on human readability by adding a lot more syntactic sugar and features on top of JSON. As a result, YAML is more applicable to configuration files edited by hand rather than as a transport layer.


Install the PyYAML Library
Python’s most popular third-party YAML library by far is PyYAML, which is consistently one of the top packages downloaded from PyPI. It has an interface that looks somewhat similar to the built-in JSON module, it’s actively maintained, and it has the blessing of the official YAML website, which lists it alongside a few less popular contenders.


To install PyYAML into your active virtual environment, type the following command in your terminal:


person: !!python/object:package_name.module_name.ClassName
  age: 42
  first_name: John
  last_name: Doe
The use of the !!str tag next to a date object makes YAML treat it as a regular string. Question marks (?) denote a mapping key in YAML. They’re usually unnecessary but can help you define a compound key from another collection or a key that contains reserved characters. In this case, you want to define blank keys to create a set data structure, which is equivalent to a mapping without the keys.


The three wrappers that delegate to yaml.dump_all() have the following function signatures, which reveal their positional arguments:


Let’s run this node with a non declared parameter:


##  Summary  ï


If you’ve ever worked with Docker or Kubernetes, you’ll have likely used YAML files. From configuring an application’s services in Docker to defining Kubernetes objects like pods, services, and more—YAML is used for them all.


Dump Multiple Documents
The two YAML-dumping functions in PyYAML, dump() and safe_dump(), have no way of knowing whether you mean to serialize multiple separate documents or a single document comprising an element sequence:


Now, why not take your newfound knowledge a step further? Try converting JSON to CSV next.


An actual markup language, such as Markdown or HTML, lets you annotate text with formatting or processing instructions intermixed with your content. Markup languages are, therefore, primarily concerned with text documents, whereas YAML is a data serialization format that integrates well with common data types native to many programming languages. There’s no inherent text in YAML, only data to represent.


Advertisement


Lines 5 to 11 import the needed event types from PyYAML.
Lines 13 and 14 specify the event types corresponding to HTML opening and closing tags.
Lines 24 to 37 append the corresponding HTML tag and update the stack as necessary.
Lines 21, 22, 39, and 40 open or close pending tags on the stack and optionally update the number of key-value pairs processed.
The missing part is the helper method responsible for opening and closing matching tags when necessary:


script.py
Copydata2 = [
    {
    'apiVersion': 'v1',
    'kind':'persistentVolume',
    'metadata': {'name':'mongodb-pv', 'labels':{'type':'local'}},
    'spec':{'storageClassName':'hostpath'},
    'capacity':{'storage':'3Gi'},
    'accessModes':['ReadWriteOnce'],
    'hostpath':{'path':'/mnt/data'}
    },


Ansible: Uses YAML to describe the desired state of the remote infrastructure, manage the configuration, and orchestrate IT processes
Docker Compose: Uses YAML to describe the microservices comprising your Dockerized application
Kubernetes: Uses YAML to define various objects in a computer cluster to orchestrate and manage
Apart from that, some general-purpose tools, libraries, and services give you the option to configure them through YAML, which you may find more convenient than other data formats. For example, platforms like CircleCI and GitHub frequently turn to YAML to define continuous integration, deployment, and delivery (CI/CD) pipelines. The OpenAPI Specification allows for code stub generation based on a YAML description of RESTful APIs.


Get Source Code: Click here to get the source code you’ll use to work with YAML in Python.


YAML: The Missing Battery in Python
YAML: The Missing Battery in Python
by Bartosz Zaczyński 2 Comments
 intermediate
Share Share Email
Table of Contents


If you want to dump your YAML into a file, then be sure to open the file in write mode. Additionally, you must specify the character encoding through an optional keyword argument to the yaml.dump() function when the file is open in binary mode:


script.py
Copydef read_multiple_block_of_yaml_data(filename,write_file):
    with open(f'{filename}.yaml','r') as f:
        data = yaml.safe_load_all(f)
        loaded_data = list(data)
    with open(f'{write_file}.yaml', 'w') as file:
        yaml.dump_all(loaded_data,file, sort_keys=False)
    print('done!')


Note: The documentation for Python’s logging framework mentions YAML despite the fact that the language doesn’t support YAML natively.


>>> yaml.dump(complex(3, 2))
"!!python/complex '3.0+2.0j'\n"
In the first case, the safe dumper doesn’t know how to represent your complex number in YAML. On the other hand, calling yaml.dump() implicitly uses the unsafe Dump class behind the scenes, which takes advantage of the !!python/complex tag. It’s a similar story when you try to dump a custom class:


Let’s define a Python function write_yaml_to_file() that converts a Python object into YAML and writes it into a file.