GithubHelp home page GithubHelp logo

huchunxu / ros_exploring Goto Github PK

View Code? Open in Web Editor NEW
945.0 945.0 565.0 147.2 MB

《ROS机器人开发实践》源码

Home Page: https://www.guyuehome.com

CMake 5.92% Python 72.06% Jupyter Notebook 0.42% C++ 2.85% Lua 0.10% C 4.45% MATLAB 0.39% JavaScript 11.58% HTML 0.18% Shell 0.05% Starlark 2.02%

ros_exploring's Introduction

《ROS机器人开发实践》源码


book_image

文件夹名 描述
ros_primary ROS基础功能
robot_mrobot mrobot相关的功能包
robot_marm marm相关的功能包
robot_perception 机器人感知相关的功能包
ros_advanced ROS进阶功能
robot_learning 机器学习相关的功能包
ros2 ROS2功能包(不能放置在ROS1的工作空间下,否则会报错)

更多内容请访问:


怕什么真理无穷,进一寸有一寸的欢喜。 —— 胡适

ros_exploring's People

Contributors

huchunxu avatar jackma-coder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros_exploring's Issues

A problem about navigation

Hi ,I run the code of mrobot_navigation, when I give the 2D Nav Goal, robot won't move as the green path,instead, it moves irregular, and it seems that it won't arrive the goal, so I am wanderring why? Is it normal?
Thank you

cartographer建图中小车和雷达分离了

胡老师你好
我在学习第9章cartographer中,在安装好cartographer后,测试museum的demo正常,但是在本章中的建图程序时出现了建图中rviz中的雷达和车身分离了,但是gazebo中的还是正常的,如下图所示:
9db69ebc203521c8a021b194aea8637
162934725478d261d92b1a04aab81f7

我想问下这是什么原因导致的,该怎么解决呢?
我的环境时ubuntu18.04,ros是melodic

when i run "roslaunch mrobot_gazebo view_mrobot_gazebo.launch " a lots of errors appear(my ROS version is noetic)

roslaunch mrobot_gazebo view_mrobot_gazebo.launch
... logging to /home/lansher/.ros/log/289feef6-5267-11ec-b666-bfd761c8268d/roslaunch-lansher-41626.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://lansher:36657/

SUMMARY

PARAMETERS

  • /gazebo/enable_ros_network: True
  • /robot_description: <?xml version="1....
  • /robot_state_publisher/publish_frequency: 50.0
  • /rosdistro: noetic
  • /rosversion: 1.15.13
  • /use_sim_time: False

NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
joint_state_publisher (joint_state_publisher/joint_state_publisher)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [41642]
process[gazebo_gui-2]: started with pid [41646]
process[joint_state_publisher-3]: started with pid [41652]
process[robot_state_publisher-4]: started with pid [41653]
process[urdf_spawner-5]: started with pid [41654]
[ WARN] [1638336988.298653637]: link 'base_link' material 'yellow' undefined.
[ WARN] [1638336988.300318404]: link 'base_link' material 'yellow' undefined.
[INFO] [1638336988.721806]: Loading model XML from ros parameter robot_description
[INFO] [1638336988.727805]: Waiting for service /gazebo/spawn_urdf_model
[INFO] [1638336988.734066]: Calling service /gazebo/spawn_urdf_model
[ERROR] [1638336988.740478559]: SpawnModel: Failure - model name mrobot already exist.
[INFO] [1638336988.740820]: Spawn status: SpawnModel: Failure - entity already exists.
[ERROR] [1638336988.742357]: Spawn service failed. Exiting.
[gazebo-1] process has died [pid 41642, exit code 255, cmd /home/lansher/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzserver -e ode /home/lansher/catkin_ws/src/mrobot_gazebo/worlds/playground.world __name:=gazebo __log:=/home/lansher/.ros/log/289feef6-5267-11ec-b666-bfd761c8268d/gazebo-1.log].
log file: /home/lansher/.ros/log/289feef6-5267-11ec-b666-bfd761c8268d/gazebo-1*.log
[ INFO] [1638336988.994434910]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1638336988.996864370]: Finished loading Gazebo ROS API Plugin.
[ WARN] [1638336989.039222925, 630.580000000]: Shutdown request received.
[ WARN] [1638336989.039411879, 630.580000000]: Reason given for shutdown: [[/gazebo_gui] Reason: new node registered with same name]
[urdf_spawner-5] process has died [pid 41654, exit code 1, cmd /home/lansher/catkin_ws/devel/lib/gazebo_ros/spawn_model -urdf -model mrobot -param robot_description __name:=urdf_spawner __log:=/home/lansher/.ros/log/289feef6-5267-11ec-b666-bfd761c8268d/urdf_spawner-5.log].
log file: /home/lansher/.ros/log/289feef6-5267-11ec-b666-bfd761c8268d/urdf_spawner-5*.log
Trace/breakpoint trap (core dumped)

`

导航中局部规划路径出现混乱

胡老师您好:
我在学习和实践导航算法过程中发现局部路径规划有时候会出现混乱,如下图所示,这是什么原因导致的呢?怎么做可以缓解或者解决这个问题?
problem1

Error in the mrobot_gazebo

Hello
when i run your code in mrobot_gazebo
roslaunch mrobot_gazebo view_mrobot_with_camera_gazebo.launch it works well and i can control it via the mrobot_teleop.launch. But when i run the rqt_image_view.The gazebo has the error:

gzserver: /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp:546: virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*): Assertion `bAttached && "A new DepthBuffer for a RenderTarget was created, but after creation" "it says it's incompatible with that RT"' failed.
Aborted (core dumped)
[gazebo-1] process has died [pid 332, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/zxf/my_was/src/mrobot_gazebo/worlds/playground.world __name:=gazebo __log:=/home/zxf/.ros/log/c198788e-61de-11e9-86e1-7c2a31503f61/gazebo-1.log].
log file: /home/zxf/.ros/log/c198788e-61de-11e9-86e1-7c2a31503f61/gazebo-1*.log

could you give me some advice? thanks a lot!

TF_REPEATED_DATA

胡老师,您好。我的系统是Ubuntu 20.04 + noetic版本,在执行如下两条命令时

  1. roslaunch mrobot_gazebo mrobot_laser_nav_gazebo.launch
  2. roslaunch mrobot_navigation nav_demo.launch
    出现如下错误,在rviz中机器人无法定位。
    Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame wheel_right_link at time 474.383000 according to authority unknown_publisher
    at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
    Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame wheel_left_link at time 474.413000 according to authority unknown_publisher
    at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
    Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame wheel_right_link at time 474.413000 according to authority unknown_publisher
    at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
    Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame wheel_left_link at time 474.413000 according to authority unknown_publisher
    at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
    Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame wheel_right_link at time 474.413000 according to authority unknown_publisher
    at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp

关于创建hello_world的代码纠正

作者和各位读者好,我按照书中第三章ROS基础,创建hello_world功能包,发现如下错误:
按照书中教程创建3.6 创建一个Publisher(talker) 和 Subscriber(listener) 的hello_world的功能包,无法正确catkin_make.
原因是:CMakeLists.txt文件
作者的源代码如下:

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker ${PROJECT_NAME}_generate_messages_cpp)

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(talker ${PROJECT_NAME}_generate_messages_cpp)

发现无法正确catkin_make。报错如下:
image
GitHub的源代码有两个add_dependencies(talker,我觉得可能敲错了,后面一个为listener
我修改如下后可以正常运行:

include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})

原因总结:和3.6.6的自定义话题消息有关,在初学和敲代码talker和listener时,CMakeLists.txt文件不应该加入add_dependencies(talker....
这个是3.6.6的自定义话题消息 运行rosmsg show Person命令后文件新增的。应该在书中3.6.4章节(编译功能包)中不加入add_dependencies(talker ${PROJECT_NAME}_generate_messages_cpp) 以及add_dependencies(listener${PROJECT_NAME}_generate_messages_cpp),否则catkin_make失败。

本人初学ROS,希望提出这个小问题,增强和大家的互动性,提高学习动力。手动加油😀

python版本

只看源码print加括号了,以为用的python3,后来才发现是2

Error in mrobot_navigation when roslaunch move_base.launch

i try to roslaunch mrobot_navigation fake_nav_cloister_demo.launch, and then it doesn't work:
the terminal says that >>

Warning: Invalid argument "/map" passed to canTransform argument target_frame in tf2 frame_ids cannot start with a '/' like:
at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.3/src/buffer_core.cpp
i set up the navigation goal, but the car didn't move...

And i found the solution on the internet: ros-planning/navigation#794

solve it by removing the "/" in global_costmap_params.yaml and local_costmap_params.yaml

finally, it works.

求更新到melodic版本

在melodic上编译时,会报错,卡在了缺少manipulation_msgsConfig.cmake和manipulation_msgs-config.cmake文件,据我所知,是Kinect版本有的

gazebo仿真中无法使用键盘控制小车移动

胡老师您好:
我刚刚开始学习ros机器人,现在我仿照您写的ros机器人开发上的案例写了一个urdf小车描述文件,在加载进gazebo是正常的,但是我启用键盘控制,我发现小车不会动,这是什么问题阿。
以下是我的xacro文件内容:
`
<xacro:macro name="sphere_inertial_matrix" params="m r">




</xacro:macro>

<xacro:macro name="cylinder_inertial_matrix" params="m r h">
    <inertial>
        <mass value="${m}" />
        <inertia ixx="${m*(3*r*r+h*h)/12}" ixy = "0" ixz = "0"
            iyy="${m*(3*r*r+h*h)/12}" iyz = "0"
            izz="${m*r*r/2}" /> 
    </inertial>
</xacro:macro>

<xacro:macro name="box_inertial_matrix" params="m w h d">
    <inertial>
        <mass value="${m}" />
        <inertia ixx="${m*(h*h+d*d)/12}" ixy = "0" ixz = "0"
            iyy="${m*(w*w+d*d)/12}" iyz = "0"
            izz="${m*(w*w+h*h)/12}" /> 
    </inertial>
</xacro:macro>
<xacro:macro name="wheel" params="prefix reflect parent_link">
    <joint name="${prefix}_wheel_joint" type="continuous">
        <origin xyz="-1.012 ${reflect*wheel_joint_y} 0.04" rpy="0 0 0"/>
        <parent link="${parent_link}"/>
        <child link="${prefix}_wheel_link"/>
        <axis xyz="0 1 0"/>
    </joint>

    <link name="${prefix}_wheel_link">

        <visual>
            <origin xyz="0 0 0" rpy="${M_PI/2} 0 0"/>
            <geometry>
                <cylinder length="0.08" radius="0.04" />
            </geometry>
            <material name="gray"/>
        </visual>

        <collision>
            <origin xyz="0 0 0" rpy="${M_PI/2} 0 0"/>
            <geometry>
                <cylinder length="0.08" radius="0.04" />
            </geometry>
        </collision>
        <cylinder_inertial_matrix  m="0.1" r="0.04" h="0.08" />
    </link>
    <gazebo reference="${prefix}_wheel_link">
        <material>Gazebo/Gray</material>
    </gazebo>

    <!-- Transmission is important to link the joints and the controller -->
    <transmission name="${prefix}_wheel_trans">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="${prefix}_wheel_joint" />
        <actuator name="${prefix}_wheel_joint_motor">
            <hardwareInterface>VelocityJointInterface</hardwareInterface>  <!--VelocityJointInterface-->
            <mechanicalReduction>1</mechanicalReduction>
        </actuator>
    </transmission>

</xacro:macro>

<!-- wan xiang lun -->
<xacro:macro name="caster" params="prefix reflect parent_link">
    <joint name="${prefix}_caster_joint" type="continuous">
        <origin xyz="-0.0671 ${reflect*caster_joint_y} 0.08" rpy="0 0 0"/>
        <parent link="${parent_link}"/>
        <child link="${prefix}_caster_link"/>
        <axis xyz="0 1 0"/>
    </joint>

    <link name="${prefix}_caster_link">

        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <sphere radius="0.08" />
            </geometry>
            <material name="gray"/>
        </visual>

        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <sphere radius="0.08" />
            </geometry>
        </collision>
        <sphere_inertial_matrix  m="0.1" r="0.08" />
    </link>

    <gazebo reference="${prefix}_caster_link">
        <material>Gazebo/Gray</material>
    </gazebo>

</xacro:macro>`

下面是我执行命令rostopic info /cmd_vel的结果:
`
Type: geometry_msgs/Twist

Publishers: None

Subscribers:

  • /gazebo (http://localhost:38097/)
    当启动键盘控制命令roslaunch mrobot_teleop mrobot_teleop.launch的结果:Type: geometry_msgs/Twist

Publishers:

Subscribers:

`
我想请教下我该怎么改才能正确使用键盘控制小车呢?

还有就是我想请问下有什么值的推荐的ros学习论坛么么?目前遇到问题都不知道去哪里提问。

gazebo 加载world时特别慢

古月老师,还有一个问题就是,在我使用Gazebo做机器人仿真的时候, 当我在world文件上添加几个模型和物体的时,然后启动gazabe, 常常出现gazebo world加载不出来的情况,然后我的CPU GPU还有内存都还有很大余量,不知为什么world为何加载不出来。请问这种情况,有改进或者加速的办法吗

screenshot from 2019-01-14 19-15-28

screenshot from 2019-01-14 19-16-25

6.2.4运行launch文件报错[joint_state_publisher-2] process has died

古月老师你好,我的ubuntu版本是18.04,ros版本是melodic,在运行6.2.4的launch文件的时候遇到下面这个报错
2020-05-31 17-44-49 的屏幕截图
rviz打开后缺少两边的轮子
2020-05-31 17-46-14 的屏幕截图
并且有这样的报错
2020-05-31 17-46-59 的屏幕截图
按网上的方法也试过了sudo apt-get install ros-melodic-joint-state-publisher-gui,但是没有效果,请问可能是哪里出了问题?

关于robot_voice

您好,在使用robot_voice源码包时,carkin_make出现/usr/bin/ld: cannot find -lmsc,请问这个问题怎么解决

有关于.rviz文件的作用问题

您好,在navigation仿真导航中,如果删除了rviz文件夹中已经跑出图并保存好的.rviz文件,则在roslaunch mrobot_navigation fake_nav_cloister_demo.launch时,rviz仿真界面中的displays就会只显示默认标签,没有map、odometry、inflated obstacles等书中实例结果所显示的标签。

when i run "roslaunch mrobot_gazebo view_mrobot_gazebo.launch " .There is no robot model appears in gazebo (my ROS version is noetic)

isn't appear model in gazebo

roslaunch mrobot_gazebo view_mrobot_gazebo.launch
... logging to /home/lansher/.ros/log/289feef6-5267-11ec-b666-bfd761c8268d/roslaunch-lansher-42369.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://lansher:44513/

SUMMARY

PARAMETERS

  • /gazebo/enable_ros_network: True
  • /robot_description: <?xml version="1....
  • /robot_state_publisher/publish_frequency: 50.0
  • /rosdistro: noetic
  • /rosversion: 1.15.13
  • /use_sim_time: False

NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
joint_state_publisher (joint_state_publisher/joint_state_publisher)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [42385]
process[gazebo_gui-2]: started with pid [42389]
process[joint_state_publisher-3]: started with pid [42395]
process[robot_state_publisher-4]: started with pid [42396]
process[urdf_spawner-5]: started with pid [42397]
[ WARN] [1638337379.958729611]: Shutdown request received.
[ WARN] [1638337379.958785104]: Reason given for shutdown: [[/robot_state_publisher] Reason: new node registered with same name]
[ WARN] [1638337379.961768081]: link 'base_link' material 'yellow' undefined.
[ WARN] [1638337379.963353600]: link 'base_link' material 'yellow' undefined.
[INFO] [1638337380.393707]: Loading model XML from ros parameter robot_description
[INFO] [1638337380.399691]: Waiting for service /gazebo/spawn_urdf_model
[WARN] [1638337380.403952]: wait_for_service(/gazebo/spawn_urdf_model): failed to contact, will keep trying
[ INFO] [1638337380.563418959]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1638337380.565506077]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1638337380.634588913]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1638337380.636105684]: Finished loading Gazebo ROS API Plugin.
[INFO] [1638337381.010323]: wait_for_service(/gazebo/spawn_urdf_model): finally were able to contact [rosrpc://lansher:51887]
[INFO] [1638337381.013769]: Calling service /gazebo/spawn_urdf_model
[ INFO] [1638337381.045061249]: waitForService: Service [/gazebo/set_physics_properties] is now available.

libcurl: (5) Could not resolve proxy: http
[INFO] [1638337381.216835]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1638337381.230930738]: Physics dynamic reconfigure ready.
[ INFO] [1638337381.240718709]: Starting plugin DiffDrive(ns = //)
[ INFO] [1638337381.241129999]: DiffDrive(ns = //): = Debug
[ INFO] [1638337381.242247061]: DiffDrive(ns = //): <tf_prefix> =
[DEBUG] [1638337381.242596085]: DiffDrive(ns = //): = cmd_vel
[DEBUG] [1638337381.242618036]: DiffDrive(ns = //): = odom
[DEBUG] [1638337381.242630840]: DiffDrive(ns = //): = odom
[DEBUG] [1638337381.242644636]: DiffDrive(ns = //): = base_footprint
[DEBUG] [1638337381.242714316]: DiffDrive(ns = //): = true
[ WARN] [1638337381.242732851]: DiffDrive(ns = //): missing default is true
[DEBUG] [1638337381.242759431]: DiffDrive(ns = //): = true
[DEBUG] [1638337381.243152116]: DiffDrive(ns = //): = 0.26000000000000001
[DEBUG] [1638337381.243181581]: DiffDrive(ns = //): = 0.066000000000000003
[DEBUG] [1638337381.243204364]: DiffDrive(ns = //): = 1.8
[DEBUG] [1638337381.243227327]: DiffDrive(ns = //): = 30
[DEBUG] [1638337381.243246693]: DiffDrive(ns = //): = 100
[ WARN] [1638337381.243931035]: DiffDrive(ns = //): missing default is 1
[DEBUG] [1638337381.244192014]: DiffDrive(ns = //): = base_to_wheel_left_joint

关于乌龟例程中的服务-创建一只新的小乌龟,严格命令格式的问题

学习了3.7.1 乌龟例程中的服务,动手敲一遍代码,发现书中以下代码无法运行:
rosservice call /spawn "x:8.0 y:8.0 theta:0.0 name:'turtle2'"
提示格式错误

Incompatible arguments to call service:
Not enough arguments:
 * Given: ["x:8.0 y:8.0 theta:0.0 name:'turtle2'"]
 * Expected: ['x', 'y', 'theta', 'name']
Provided arguments are:
 * x:8.0 y:8.0 theta:0.0 name:'turtle2' (type str)

我使用了严格的json格式,成功:
rosservice call /spawn "{'x':8.0,'y':8.0,'theta':0.0,'name':'turtle2'}"
希望对大家有帮助。
贴上我的ROS版本(roscore):1.12.17

No definition of [python-gst] for OS version [xenial]

<run_depend>python-gst</run_depend>

xilinx@pc1:~/catkin_ws$ rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
pocketsphinx: No definition of [python-gst] for OS version [xenial]
sudo apt install python-gst-1.0

这里依赖的gst包的名称似乎应该是python-gst-1.0

moveit and gazebo

胡老师您好,我在本书第10.12.4章节中,运行Moveit和Gazebo的launch文件
$ roslaunch marm_gazebo arm_bringup_moveit.launch 时出现了问题,想请教您一下?
运行时gazebo和rviz都能正常启动,使用moveit进行规划时,只有rviz中的机械臂可以运动,gazebo中的机械臂不能一起运动,出现下面的错误是什么原因呢?
[ERROR] [1543648302.946867035, 54.954000000]: Unable to identify any set of controllers that can actuate the specified joints: [ joint1 joint2 joint3 joint4 joint5 joint6 ]
[ERROR] [1543648302.946922001, 54.954000000]: Known controllers and their joints:

[ERROR] [1543648302.946988980, 54.954000000]: Apparently trajectory initialization failed

导航中遇到的问题

胡老师你好
我在学习9.10.2章中的gazebo仿真导航中遇到了两个问题:

  1. 我发现仿真导航中绿色的导航线不是一次性画出来的,而是慢慢延伸出来的,这个是否正常
  2. 我发现导航过程中雷达出现漂移的现象,就是原本是没有障碍物的地方也会出现红色雷达线条,这个是什么原因造成的
    从下图中可以清楚的看到:
    Screenshot 2021-11-04 03:01:56

MoveIt机械臂控制章节运行代码出错

在MoveIt!编程学习章节中运行代码都出现了类似的错误,以关节空间规划为例:
运行rosrun marm_planning moveit_fk_demo.py命令后,机械臂没有运动,运行launch文件的终端输出为:

You can start planning now!

[ INFO] [1562576474.274474940]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1562576474.274891116]: Goal constraints are already satisfied. No need to plan or execute any motions
[ INFO] [1562576476.354635249]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1562576476.354985038]: Planning attempt 1 of at most 1
[ INFO] [1562576476.357638285]: Planner configuration 'gripper' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1562576476.358687775]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1562576476.369870458]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1562576476.369955176]: Solution found in 0.011544 seconds
[ INFO] [1562576476.373558468]: SimpleSetup: Path simplification took 0.003387 seconds and changed from 3 to 2 states
[ INFO] [1562576476.904228113]: Completed trajectory execution with status SUCCEEDED ...
[ INFO] [1562576478.004197492]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1562576478.004402229]: Planning attempt 1 of at most 1
[ INFO] [1562576478.005634270]: Planner configuration 'arm' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1562576478.006322077]: RRTConnect: Starting planning with 1 states already in datastructure
*** stack smashing detected **: /opt/ros/kinetic/lib/moveit_ros_move_group/move_group terminated
[move_group-5] process has died [pid 3031, exit code -6, cmd /opt/ros/kinetic/lib/moveit_ros_move_group/move_group __name:=move_group __log:=/home/tfwang/.ros/log/e1019aec-a15e-11e9-a219-88b11175f2f1/move_group-5.log].
log file: /home/tfwang/.ros/log/e1019aec-a15e-11e9-a219-88b11175f2f1/move_group-5
.log

Gazebo启动不报错,但是黑屏

胡老师你好,我正在看ROS机器人开发实践,在运行第6章6.7.2小节中的命令:roslaunch mrobot_gazebo view_mrobot_gazebo.launch时,出现Gazebo启动黑屏,但是没有出现错误。下面介绍我的经历流程:
(1)第一次运行命令:roslaunch mrobot_gazebo view_mrobot_gazebo.launch 出现[REST.cc:205] Error in REST request,通过网上查找,解决了此问题:https://blog.csdn.net/qq_32618327/article/details/104199258
(2)再次运行命令:roslaunch mrobot_gazebo view_mrobot_gazebo.launch ,出现Gazebo黑屏,但是不报错的问题。通过网上查找,可能是因为缺少模型导致的,但是我并不确定是否就是我现在面对的问题:https://blog.csdn.net/chenguangbiao/article/details/120199728
想请教下老师该怎么解决这个问题,如果是缺少模型导致的,我该去哪下载相关模型?

ImportError: No module named defusedxml.xmlrpc

当我运行roslaunch mrobot_gazebo view_mrobot_gazebo.launch,发现有错误

ubuntu16.04
ROS Kinetic
ROS机器人开发实践 P146 6.72节

Traceback (most recent call last):
File "/opt/ros/kinetic/lib/xacro/xacro", line 32, in
import xacro
File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/init.py", line 42, in
from roslaunch import substitution_args
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py", line 56, in
from .launch import ROSLaunchRunner
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 55, in
from roslaunch.nodeprocess import create_master_process, create_node_process
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py", line 52, in
from rosmaster.master_api import NUM_WORKERS
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/init.py", line 35, in
from .main import rosmaster_main
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/main.py", line 43, in
import rosmaster.master
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master.py", line 47, in
import rosmaster.master_api
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 72, in
from rosmaster.util import xmlrpcapi
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 48, in
from defusedxml.xmlrpc import monkey_patch
ImportError: No module named defusedxml.xmlrpc

然后我使用xacro.py工具 查看一下mrobot.urdf.xacro,有类似的错误

roscore
rosrun xacro xacro.py --check-order mrobot.urdf.xacro

Traceback (most recent call last):
File "/opt/ros/kinetic/share/xacro/xacro.py", line 55, in
import xacro
File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/init.py", line 42, in
from roslaunch import substitution_args
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py", line 56, in
from .launch import ROSLaunchRunner
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 55, in
from roslaunch.nodeprocess import create_master_process, create_node_process
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py", line 52, in
from rosmaster.master_api import NUM_WORKERS
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/init.py", line 35, in
from .main import rosmaster_main
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/main.py", line 43, in
import rosmaster.master
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master.py", line 47, in
import rosmaster.master_api
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 72, in
from rosmaster.util import xmlrpcapi
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 48, in
from defusedxml.xmlrpc import monkey_patch
ImportError: No module named defusedxml.xmlrpc

但是实际上我的 python环境中 xacro defusedxml都已经有了呀

所以想请问作者一下,这个问题怎么解决好呢

机器人模型左右轮的疑问

胡老师您好
https://github.com/huchunxu/ros_exploring/blob/master/robot_mrobot/mrobot_description/urdf/mrobot_body.urdf.xacro

        <joint name="base_left_motor_joint" type="fixed">
            <origin xyz="${motor_x} ${motor_y} 0" rpy="0 0 0" />        
            <parent link="base_link"/>
            <child link="left_motor" />
        </joint>

        <joint name="left_wheel_joint" type="continuous">
            <origin xyz="0 ${(motor_length+wheel_length)/2} 0" rpy="0 0 0"/>
            <parent link="left_motor"/>
            <child link="left_wheel_link"/>
            <axis xyz="0 1 0"/>
        </joint>

        <joint name="base_right_motor_joint" type="fixed">
            <origin xyz="${motor_x} -${motor_y} 0" rpy="0 0 0" />        
            <parent link="base_link"/>
            <child link="right_motor" />
        </joint>

        <joint name="right_wheel_joint" type="continuous">
            <origin xyz="0 -${(motor_length+wheel_length)/2} 0" rpy="0 0 0"/>
            <parent link="right_motor"/>
            <child link="right_wheel_link"/>
            <axis xyz="0 1 0"/>
        </joint>

motor_x 是负的, motor_y, motor_lengthwheel_length 都是正的
左轮joint的y是正的,右轮joint的y是负的
这也符合+x向前,+y向左,+z向上的定义
根据 gazebo 教程 http://gazebosim.org/tutorials?tut=guided_b3 ,确实是这样定义的

但是在 https://github.com/huchunxu/ros_exploring/blob/master/robot_mrobot/mrobot_gazebo/urdf/mrobot_body.urdf.xacro

        <joint name="base_to_wheel_${lr}_joint" type="continuous">
            <parent link="base_link"/>
            <child link="wheel_${lr}_link"/>
            <origin xyz="${motor_x} ${translateY * base_link_radius} 0" rpy="0 0 0" /> 
            <axis xyz="0 1 0" rpy="0  0" />
        </joint>


        <wheel lr="right"  translateY="1" />
        <wheel lr="left"  translateY="-1" />

motor_x 是负的, base_link_radius 是正的
左轮joint的 y 是负的,右轮joint的 y 是正的,这与之前看到的定义是冲突的

请问这是以下哪种情况

  • 我的理解有问题,就应该是那样的
  • 打字错误
  • 在某处做了配套的对应改动,使得它仍然是对的,我没意识到

如果不是打字错误,能否解答一下我的疑惑,感谢!

另外我跑过6.7.3的mbot_teleop,源码的状况符合真实指令的要求,自己改了translateY的正负性之后反而反了。

有关于功能包的一些问题

古月老师,你好,请问你《ros机器人开发实践》的源码,也就是ros_exploring中有好几个文件夹,以robot_mrobot为例,它包含好几个功能包,像mrobot_bringup、mrobot_description这些的,那我把你的源码复制到我工作空间的src文件夹中,是应该把mrobot_bringup、mrobot_description这些功能包一个个复制过来,还是说我直接复制robot_mrobot这个文件夹就行

kinect 驱动问题

g@g-system-product-name:/SensorKinect/Bin$ cd Sensor-Bin-Linux-x64-v5.1.2.1/
g@g-system-product-name:
/SensorKinect/Bin/Sensor-Bin-Linux-x64-v5.1.2.1$ ls
Bin Config GPL.txt Install install.sh LGPL.txt Lib
g@g-system-product-name:/SensorKinect/Bin/Sensor-Bin-Linux-x64-v5.1.2.1$ ls Install/
55-primesense-usb.rules blacklist-gspca-kinect.conf
g@g-system-product-name:
/SensorKinect/Bin/Sensor-Bin-Linux-x64-v5.1.2.1$ sudo ./install.sh
[sudo] password for g:
Installing PrimeSense Sensor


creating config dir /usr/etc/primesense...OK
copying shared libraries...OK
copying executables...OK
registering module 'libXnDeviceSensorV2KM.so' with OpenNI...OK
registering module 'libXnDeviceFile.so' with OpenNI...OK
copying server config file...OK
setting uid of server...OK
creating server logs dir...OK
installing usb rules...OK
installing modprobe blacklist...OK

*** DONE ***

我的系统是ubuntu 16.04 安装驱动显示也成功 但是为什么还是显示没有设备连接呢?

Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://g-system-product-name:43641/

SUMMARY

PARAMETERS

  • /camera/camera_nodelet_manager/num_worker_threads: 4
  • /camera/depth_registered_rectify_depth/interpolation: 0
  • /camera/driver/data_skip: 0
  • /camera/driver/debug: False
  • /camera/driver/depth_camera_info_url:
  • /camera/driver/depth_frame_id: camera_depth_opti...
  • /camera/driver/depth_registration: True
  • /camera/driver/device_id: #1
  • /camera/driver/diagnostics_max_frequency: 30.0
  • /camera/driver/diagnostics_min_frequency: 30.0
  • /camera/driver/diagnostics_tolerance: 0.05
  • /camera/driver/diagnostics_window_time: 5.0
  • /camera/driver/enable_depth_diagnostics: False
  • /camera/driver/enable_ir_diagnostics: False
  • /camera/driver/enable_rgb_diagnostics: False
  • /camera/driver/rgb_camera_info_url:
  • /camera/driver/rgb_frame_id: camera_rgb_optica...
  • /rosdistro: kinetic
  • /rosversion: 1.12.14

NODES
/camera/
camera_nodelet_manager (nodelet/nodelet)
depth_registered_hw_metric_rect (nodelet/nodelet)
depth_registered_metric (nodelet/nodelet)
depth_registered_rectify_depth (nodelet/nodelet)
driver (nodelet/nodelet)
points_xyzrgb_hw_registered (nodelet/nodelet)
rgb_debayer (nodelet/nodelet)
rgb_rectify_color (nodelet/nodelet)
rgb_rectify_mono (nodelet/nodelet)

auto-starting new master
process[master]: started with pid [5494]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to c6dc6758-ca0b-11e8-b46b-2cfda1bc2526
process[rosout-1]: started with pid [5507]
started core service [/rosout]
process[camera/camera_nodelet_manager-2]: started with pid [5524]
process[camera/driver-3]: started with pid [5525]
process[camera/rgb_debayer-4]: started with pid [5526]
process[camera/rgb_rectify_mono-5]: started with pid [5527]
process[camera/rgb_rectify_color-6]: started with pid [5536]
process[camera/depth_registered_rectify_depth-7]: started with pid [5557]
process[camera/points_xyzrgb_hw_registered-8]: started with pid [5567]
process[camera/depth_registered_hw_metric_rect-9]: started with pid [5583]
process[camera/depth_registered_metric-10]: started with pid [5592]
[ INFO] [1538901257.110013562]: Initializing nodelet with 4 worker threads.
[ INFO] [1538901257.211923164]: No devices connected.... waiting for devices to be connected
[ INFO] [1538901260.212137123]: No devices connected.... waiting for devices to be connected
[ INFO] [1538901263.212348427]: No devices connected.... waiting for devices to be connected
[ INFO] [1538901266.212569534]: No devices connected.... waiting for devices to be connected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.