码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 远端rostopic的本地rviz调用及显示


    假设
    机器人的IP: 192.168.0.11 // remote computer (robot)
    本地PC的IP: 192.168.0.111 // local computer Ubuntu (host)
    查看IP地址的方法: 参考1,参考2

    本地PC通过ssh链接远端机器人,如利用Mobaxterm或VSCode

    在远端的命令行终端内输入如下命令:

    export ROS_MASTER_URI=http://192.168.0.11:11311   //this ensures that we do not use localhost, but the real IP address as master node 
    export ROS_IP=192.168.0.11 		//this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)
    
    • 1
    • 2

    然后

    roscore
    
    • 1

    远端插上usb摄像头,参考ROS调用USB双目摄像头模组调用usb_cam,跑通后会有如下一堆topic:
    在这里插入图片描述

    然后打开本地PC的终端,输入如下命令:

    export ROS_MASTER_URI=http://192.168.0.11:11311   //tells local computer to look for the remote here
    export ROS_IP=192.168.0.111		//this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)
    
    • 1
    • 2

    “11311”代表啥目前我还不清除…… 知道的大佬感谢您在评论区告诉我!

    然后

    rosrun rviz rviz 	// fires up rviz on local computer. It will attach to the master node of the remote computer
    
    • 1

    在这里插入图片描述

    使用上面export的方式每次打开一个终端都要输入一遍。
    如果用的比较多,为了方便,也可以直接修改环境变量:

    sudo gedit ~/.bashrc //add the two export commands at the end of the file.
    source ~/.bashrc //and restart terminal
    
    • 1
    • 2

    但是记得不需要的时候去掉上面export的命令!

    Reference

    ROS之旅(六)远端rviz监控
    rviz远程桌面启动问题解决,多机器分布式本地运行rviz
    Ubuntu查看IP地址
    ubuntu查看ip地址命令(如何在 Ubuntu 中检查你的 IP 地址)

  • 相关阅读:
    【计算机网络】网络基础(二)
    【命令式编程和声明式编程】
    Vue的过滤器(filter)
    Kafka之常用参数配置整理
    远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug
    ElasticSearch中keyword和text类型区别和模糊查询
    22071华清远见(上海中心)
    iOS基础开发介绍
    Java main方法
    像 bootstrapTable 一样好用的Excel 导出
  • 原文地址:https://blog.csdn.net/weixin_48592526/article/details/125500069
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号