当前位置:   article > 正文

Ubuntu-Sim2Real环境配置(下)

sim2real
  1. cd ICRA-RM-Sim2Real/docker_client/
  2. ./exec_client.sh
  3. cd ~
  4. roslaunch rtab_navigation rtab_navigation.launch

执行上面代码的时候后台一直刷新

  1. cd ICRA-RM-Sim2Real/docker_client/
  2. ./exec_client.sh
  3. cd ~
  4. roslaunch carto_navigation navigation.launch

 1.Usage

执行该代码的时候出现了下面的问题

使用下面代码打开bashrc文件

nano ~/.bashrc

将最后的下面的代码

  1. # enable programmable completion features (you don't need to enable
  2. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  3. # sources /etc/bash.bashrc).
  4. if ! shopt -oq posix; then
  5. if [ -f /usr/share/bash-completion/bash_completion ]; then
  6. . /usr/share/bash-completion/bash_completion
  7. elif [ -f /etc/bash_completion ]; then
  8. . /etc/bash_completion
  9. fi
  10. fi
  11. # >>> fishros initialize >>>
  12. source /opt/ros/noetic/setup.bash
  13. # <<< fishros initialize <<<
  14. # >>> fishros scripts >>>
  15. export PATH=$PATH:/home/see/.fishros/bin/
  16. # <<< fishros scripts <<<

改为

  1. # enable programmable completion features (you don't need to enable
  2. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  3. # sources /etc/bash.bashrc).
  4. if ! shopt -oq posix; then
  5. if [ -f /usr/share/bash-completion/bash_completion ]; then
  6. . /usr/share/bash-completion/bash_completion
  7. elif [ -f /etc/bash_completion ]; then
  8. . /etc/bash_completion
  9. fi
  10. fi
  11. source /opt/ros/kinetic/setup.bash
  12. export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/home/sz/catkin_ws/src
  13. export ROS_HOSTNAME=localhost
  14. export ROS_MASTER_URI=http://localhost:11311
  15. #source ~/racecar/devel/setup.bash

不过当我重新跑代码的时候,变成了这样,我的rviz黑屏了

副了,所以我把前面的一步撤回,查看

参考下面的博客,但是学长劝我别删除,所以我没管

https://wenku.csdn.net/answer/8fc926b10bb8df864ba9fc7ffde92f4b

 Ubuntu虚拟机删除dev/loop_sudo apt autoremove --purge snapd-CSDN博客

配置下面代码的时候

  1. cd ICRA-RM-Sim2Real/docker_client/
  2. ./exec_client.sh
  3. roscd ep_detect_and_grasp
  4. python3 detect_cube.py

出现了这个问题

  1. (frame:406): Gdk-ERROR **: 05:10:35.111: The program 'frame' received an X Window System error.
  2. This probably reflects a bug in the program.
  3. The error was 'BadAccess (attempt to access private resource denied)'.
  4. (Details: serial 295 error_code 10 request_code 130 (MIT-SHM) minor_code 1)
  5. (Note to programmers: normally, X errors are reported asynchronously;
  6. that is, you will receive the error a while after causing it.
  7. To debug your program, run it with the GDK_SYNCHRONIZE environment
  8. variable to change this behavior. You can then get a meaningful
  9. backtrace from your debugger if you break on the gdk_x_error() function.)
  10. Trace/breakpoint trap (core dumped)

 

  1. detect_cube.py:29: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  2. self.aruco_pose_pub = rospy.Publisher("aruco_pose", Pose)
  3. detect_cube.py:31: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  4. self.aruco_sink1_pub = rospy.Publisher("aruco_sink1", Pose)
  5. detect_cube.py:32: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  6. self.aruco_sink2_pub = rospy.Publisher("aruco_sink2", Pose)
  7. detect_cube.py:33: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  8. self.aruco_sink3_pub = rospy.Publisher("aruco_sink3", Pose)
  9. detect_cube.py:35: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  10. self.aruco_pose_image_pub = rospy.Publisher("aruco_pose_image", Image)
  11. (50, 50)
  12. (50, 50)
  13. (50, 50)
  14. (50, 50)
  15. (50, 50)
  16. (50, 50)

不过在我重复三次执行后,它可以调出frame画面,就是好像和指导书的不太一样就是了,无法操控它

运行下面代码的时候

  1. cd ICRA-RM-Sim2Real/docker_client/
  2. ./exec_client.sh
  3. roscd ep_detect_and_grasp
  4. python3 grasp_cube.py

出现了这个问题

The publisher should be created with an explicit keyword argument 'queue_size'.

根据提示输入下面代码 注意括号前面有反斜杠 '\'

self.base_move_position_pub = rospy.Publisher\("cmd_position", Twist\)

出现下面的问题:

bash: self.base_move_position_pub: command not found

 查看链接

rospy/Overview/Publishers and Subscribers - ROS Wiki

再次运行下面的代码的时候

  1. cd ICRA-RM-Sim2Real/docker_client/
  2. ./exec_client.sh
  3. roscd ep_detect_and_grasp
  4. python3 grasp_cube.py

虽然能出现一个frame窗口,但是有下面的信息提示:

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/816292
推荐阅读
相关标签
  

闽ICP备14008679号