ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

cmfuhrman's profile - activity

2023-04-29 13:38:58 -0500 received badge  Notable Question (source)
2023-04-29 13:38:58 -0500 received badge  Famous Question (source)
2021-02-19 12:24:02 -0500 marked best answer Gazebo not updating urdf

I suspect that my Gazebo simulation is not updating from my urdf file. To test this is made the the length of my rectangular robot 10x the normal size, and Gazebo still shows it without any change. See the photo: image description

Obviously this is not right (...or is it?)! I am worried that the changes I am making in my urdf file are not being updated in Gazebo.

Below are the launch files I am using:

bender_simulation.launch:

<launch>

    <arg name="model" default="$(find bender_model)/model.urdf.xacro"/>
    <arg name="gui" default="false" />
    <arg name="rvizconfig" default="$(find bender_model)/urdf.rviz"/>

    <include file="$(find bender_model)/gazebo.launch">
      <arg name="model" value="$(arg model)" />
    </include>

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />

    <rosparam command="load"
              file="$(find bender_model)/joints.yaml"
              ns="bender_joint_state_controller" />

    <rosparam command="load"
              file="$(find bender_model)/diffdrive.yaml"
              ns="bender_diff_drive_controller" />

    <node name="bender_controller_spawner" pkg="controller_manager" type="spawner"
        output="screen" args="bender_joint_state_controller
                              bender_diff_drive_controller"/>

    <!--node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
      <param name="default_topic" value="/bender_diff_drive_controller/cmd_vel"/>
    </node-->

<!--    <node name="teleop" pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" output="screen">
        <remap from="cmd_vel" to="/bender_diff_drive_controller/cmd_vel"/>
    </node> -->

</launch>

Gazebo.launch:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find bender_model)/model.urdf.xacro"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find bender_model)/bender_worlds/navigation_testing.world"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

  <param name="robot_description" command="$(find xacro)/xacro.py '$(find bender_model)/model.urdf.xacro'" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <!--node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" /-->

  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model robot" />

  <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="50.0" />
  </node>

</launch>
2021-02-19 12:24:02 -0500 received badge  Nice Answer (source)
2021-02-16 12:20:25 -0500 received badge  Nice Question (source)
2020-12-15 08:25:54 -0500 marked best answer ROS Gazebo Differential Drive only goes straight

I am trying to simulate my robot in Gazebo following the urdf tutorial found here to create an R2D2 model. The tutorial makes sense to me and I can successfully run it on my machine.

I tried to create my own model - a robot with left and right wheels in the center of a box and two casters on the front. I have modeled the casters as spheres setting the friction parameters to 0. The problem I am having is that my robot will only drive in the forward direction - it will not steer like the tutorial does. I am using the same rqt_robot_steering package to make the robot move but I cannot figure out why it does not turn. (Interesting side note - I copied the urdf tutorial files onto my machine and rant them in my bender_model package and was not successful in making R2D2 turn.)

All my code can be found on my github acount

I am running ROS Version: 1.12.12, Ubuntu 16.04 LTS, Gazebo 7.

I appreciate any help making my robot model turn!! I am not very good at ROS and out of ideas!!

I create my model from the model.urdf.xacro:

<?xml version="1.0"?>
<robot name="bender" xmlns:xacro="http://ros.org/wiki/xacro">

    <xacro:property name="pi" value="3.141592653589794" />
    <xacro:property name="base_len" value="0.89" />
    <xacro:property name="base_wid" value="0.80" />
    <xacro:property name="base_height" value="0.20" />
    <xacro:property name="caster_length" value="0.10" />
    <xacro:property name="caster_radius" value="0.15" />
    <xacro:property name="wheel_length" value="0.10" />
    <xacro:property name="wheel_radius" value="0.15" />
    <xacro:property name="update_rate" value="50"/>
    <xacro:property name="hokuyo_size" value="0.05"/>

    <xacro:macro name="default_inertial" params="mass">
        <inertial>
          <mass value="${mass}" />
          <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0" />
        </inertial>
    </xacro:macro>


    <material name="white">
       <color rgba="1 1 1 1.5"/>
    </material>


    <link name="base_link">
        <visual>
          <geometry>
            <box size="${base_len} ${base_wid} ${base_height}"/>
          </geometry>
          <material name="white"/>
        </visual>
        <collision>
            <geometry>
              <box size="${base_len} ${base_wid} ${base_height}"/>
            </geometry>
        </collision>
        <xacro:default_inertial mass="1"/>
    </link>


    <xacro:macro name="caster" params="position reflect">
        <joint name="${position}_wheel_joint" type="fixed">
            <parent link="base_link"/>
            <child link="${position}_wheel"/>
            <axis xyz="0 0 1"/>
            <origin xyz="${reflect*(base_wid/2)} 0 ${-1 * base_height}" rpy="${pi/2} 0 0"/>
        </joint>
        <link name="${position}_wheel">
            <visual>
                <geometry>
                    <sphere radius="${caster_radius}"/>
                </geometry>
                <material name="white"/>
            </visual>
            <collision>
                <geometry>
                  <sphere radius="${caster_radius}"/>
                </geometry>
            </collision>
            <xacro:default_inertial mass="0.5"/>
        </link>

<!-- This block provides the simulator (Gazebo) with information on a few additional
physical properties. See http://gazebosim.org/tutorials/?tut=ros_urdf for more-->
        <gazebo reference="${position}_wheel">
            <mu1 value = "0.0"/>
            <mu2 value = "0.0"/>
            <kp  value = "10000000.0"/>
            <kd  value = "1.0"/>
            <material>Gazebo/Grey/</material>
        </gazebo>
    </xacro:macro>

    <xacro:macro name="wheel" params="position reflect">
        <joint name="${position}_wheel_joint" type="continuous">
            <parent link="base_link"/>
            <child link="${position}_wheel"/>
            <axis xyz="0 0 1"/>
            <origin xyz="0 ${reflect ...
(more)
2020-11-03 21:15:35 -0500 marked best answer Julia Callback Unhandled Error

All, I am attempting to use RobotOS on Ubuntu 16.04 LTS with ROS Kinetic and Julia 0.4.5. I want to do something pretty simple - publish PWM from velocity commands. I have written the following code:

#!/usr/bin/env julia

using RobotOS
@rosimport std_msgs.msg: UInt8, Float32
rostypegen()
using std_msgs.msg

# Constants:
wheel_radius = 128.95e-3; # meters
gear_ratio = 1.0/12.0; # wheel turns/motor turns
max_rot = 2000.0; # maximum rpm of motors



function calc_pwm(target)
    target = convert(Float64, target) # make sure data types are OK
    # Calculate desired RPM
    rpm = abs(target)*60.0/(2.0*pi*wheel_radius*gear_ratio);
    if rpm > max_rot
        rpm = max_rot
    end
    # Calculte the PWM based off of RPM
    if target > 0.0
        pwm = (92.0/max_rot)*rpm+160.0;
    elseif target < 0.0
        pwm = 153.0-(92.0*rpm)/max_rot;
    else
        pwm = 155.0;
    end
end


function callback(msg::Float32Msg, pub_obj::Publisher{UInt8Msg})
    # Extract the data from rwheel_vtarget msg
    velocity = msg.data
    # Calculate the PWM
    pwm = calc_pwm(velocity)
    # Convert to ROS message
    pwm = UInt8Msg(pwm)
    # Publish the data
    publish(pub_obj, pwm)
end

function main()
    init_node("speed_to_pwm")
    #r_pub = Publisher{UInt8Msg}("Duty_Cycle_Right", queue_size=10)
    #r_sub = Subscriber{Float32Msg}("rwheel_vtarget", callback, (r_pub,), queue_size=10)
    l_pub = Publisher{UInt8Msg}("Duty_Cycle_Left", queue_size=10)
    l_sub = Subscriber{Float32Msg}("lwheel_vtarget", callback, (l_pub,), queue_size=20)
    spin()
end

if ! isinteractive()
    main()
end

When I run this script and use the rostopic pub command it works perfectly, but when I integrate (joy --> teleop_twist_joy-->twist_to_vel-->Julia Node) it gives the following error:

ERROR (unhandled task failure): InexactError()
 in call at ./no file:4294967295
 in callback at /home/connorfuhrman/catkin_ws/src/speed_to_pwm/scripts/pwm_gen.jl:67

Honestly, I am not very experienced in ROS or Julia so any help would be appreciated!

2020-04-21 16:00:09 -0500 received badge  Famous Question (source)
2019-10-15 17:48:33 -0500 received badge  Famous Question (source)
2019-02-08 05:54:14 -0500 received badge  Famous Question (source)
2019-02-03 06:39:41 -0500 marked best answer Visual Odometry with Realsense Camera

I am trying to implement a visual odometry package with my Intel Realsense camera. Is there a way to implement stereo visual odometry with this camera since the depth is calculated with infrared sensors? I am using viso2_ros package and the realsense package.

2018-10-17 10:03:29 -0500 received badge  Notable Question (source)
2018-10-10 00:37:32 -0500 received badge  Famous Question (source)
2018-10-02 15:17:44 -0500 received badge  Student (source)
2018-10-02 15:17:29 -0500 received badge  Famous Question (source)
2018-10-02 15:17:29 -0500 received badge  Notable Question (source)
2018-09-03 03:40:37 -0500 received badge  Famous Question (source)
2018-07-23 16:18:06 -0500 received badge  Famous Question (source)
2018-06-25 11:21:36 -0500 received badge  Popular Question (source)
2018-06-13 22:14:40 -0500 received badge  Notable Question (source)
2018-06-11 03:38:53 -0500 received badge  Notable Question (source)
2018-06-11 03:38:53 -0500 received badge  Famous Question (source)
2018-06-06 22:22:49 -0500 commented answer MATLAB pointCloud to PointCloud2

I was not able to publish a PointCloud2 from MATLAB easily. I was using MATLAB to process images and publish as PointClo

2018-06-05 19:06:19 -0500 received badge  Notable Question (source)
2018-06-05 16:57:26 -0500 received badge  Famous Question (source)
2018-05-31 12:22:05 -0500 marked best answer base_link vs base_footprint

I have read that the navigation stacking within ROS requires the use of base_footprint. What is the difference between base_link and base_footprint? How do I know which I should use?

2018-05-27 07:16:22 -0500 received badge  Famous Question (source)
2018-05-24 10:51:56 -0500 answered a question Problem Install: Melodic

try sudo apt-get install aptitude then sudo aptitude install python-rosinstall python-rosinstall-generator python-wstool

2018-05-23 19:24:34 -0500 commented answer MATLAB 16uc1 or 32fc1 Conversion

Thank you! I could not find any information about readXYZ and could only guess as to the meaning of the channels.

2018-05-23 19:23:27 -0500 marked best answer MATLAB 16uc1 or 32fc1 Conversion

I have some image processing code in MATLAB and am attempting to use it with ROS. I read in a PointCloud2 object and execute readRGB(ptcloud) and readXYZ(ptcloud) where I get two MATLAB images each of size 480x640x3.

Q1: I assume that a depth image of size NxMx3 gives X, Y, and Z distances as the three channels. Is this correct??

I then execute my processing and need to send a depth image back encoded in either 16uc1 or 32fc1. I have not found a built-in MATLAB function for this. I can write a conversion script myself but I am unfamiliar with these formats.

Q2: What is the general algorithm to convert my NxMx3 matrix into either format?

My depth camera node publishes a depth image in the 16uc1 format. When I subscribe to that in MATLAB and execute readImage(ros_image) I get an image of size 480x640x1 in MATLAB but when I execute rostopic echo /ros_depth_image_topic I see the data is given as "data: array: type uint8, length: 614400".

Q3: I notice this is 4806402 so why does MATLAB only read in a 480x640x1 image? How do the 614400 data points translate to only 307200 data points in MATLAB?

Thank you for any assistance offered!

================================================================================

Update 1: I went back over REP-118 -- Depth Images and understand the the distance in a depth image is the distance from the camera's z-axis. Therefore why would MATLAB's readXYZ(ptcloud) function give me a 3 channel image when a depth image is only 1 channel? Also: the 16UC1 states here that it supports int16 but I believe ROS wants uint16. When I get 2x the data represented as UInt8 does that just mean there are two 8-bit words basically being concatenated into one 16-bit data point? In other words, is each pixel represented as two UInt8 data points in the 16UC1?

2018-05-23 18:49:01 -0500 received badge  Popular Question (source)
2018-05-23 14:37:07 -0500 marked best answer depth_image_proc subscriber

I am trying to use the depth_image_proc node and am unsure how to connect it to my network. I have no experience with a nodelet and cannot seem to remap the topics correctly. Below is my output rqt_graph. image description

I wish to connect to topics published from the matlab global node and cannot subscribe correctly.

Here is my launch file:

<launch>
    <group ns="cloud_gen">
<!-- This launch file uses the depth_image_proc node to transform a color image and a depth image
    into an xyzrgb point cloud for use with the Navigation Stack -->

<!-- This file is to be used with the Intel Realsense node rs_rgbd.launch and the MATLAB code titles
     realsense_lane_detect.m outputting the processed images-->

         <arg name="rgb_camera_info"     value="/camera/color/camera_info"/>
         <arg name="rgb_rimg_ect"        value="/processed_color"/>  <!--Rectified color image-->
         <arg name="depReg_imgrect"      value="/processed_depth"/>  <!--Rectified depth image-->
         <arg name="out_cloud"           value="/white_lines"/>

        <!-- Nodelet manager for this pipeline -->
        <node pkg="nodelet" type="nodelet" args="manager"
            name="standalone_nodelet" output="screen"/>

        <!-- Construct point cloud of the rgb and depth topics -->
        <node pkg="nodelet" type="nodelet" name="depth_image_proc"
            args="load depth_image_proc/point_cloud_xyzrgb standalone_nodelet" output="screen">
            <remap from="rgb/camera_info"               to="/camera/color/camera_info" />
            <remap from="rgb/image_rect_color"          to="$(arg rgb_rimg_ect)"/>
            <remap from="depth_registered/image_rect"   to="$(arg depReg_imgrect)"/>
            <remap from="depth_registered/points"       to="$(arg out_cloud)"/>
        </node>
    </group>
</launch>

Any help is appreciated!

Edit 1: Below is the output of rosnode info on that MATLAB node.

rosnode info /matlab_global_node_59233 
    --------------------------------------------------------------------------------
    Node [/matlab_global_node_59233]
    Publications: 
     * /processed_color [sensor_msgs/Image]
     * /processed_depth [sensor_msgs/Image]
     * /rosout [rosgraph_msgs/Log]

    Subscriptions: 
     * /camera/depth_registered/points [sensor_msgs/PointCloud2]

    Services: None


    contacting node http://whitelines:42372/ ...
    Pid: 21599
    Connections:
     * topic: /rosout
        * to: /rosout
        * direction: outbound
        * transport: TCPROS
     * topic: /camera/depth_registered/points
        * to: /camera/realsense2_camera_manager (http://whitelines:44751/)
        * direction: inbound
        * transport: TCPROS
2018-05-23 12:43:23 -0500 edited question MATLAB 16uc1 or 32fc1 Conversion

MATLAB 16uc1 or 32fc1 Conversion I have some image processing code in MATLAB and am attempting to use it with ROS. I rea

2018-05-23 10:51:11 -0500 marked best answer Create PointCloud2 in Matlab

I am looking to create a PointCloud2 message in MATLAB and publish back to ROS via the Robotics Systems Toolbox. I am receiving a PointCloud2 message from my Intel Realsense camera and processing the RGB data for a lane detection algorithm. I am then using the distance data to know how far away the line is and to also integrate into my local Costmap for use in the Navigation Stack.

Is there a quick and dirty way to create this message in MATLAB. There is a function called readRGB and readXYZ within MATLAB to extract a depth image and a color image from the rgbd PointCloud2 but I cannot get that information back into the PointCloud2 message. I am not very familiar with using Point Clouds and would appreciate any help!!

2018-05-23 10:50:50 -0500 marked best answer MATLAB pointCloud to PointCloud2

I am looking to convert a MATLAB pointCloud object to a ROS PointCloud2 message. My application is receiving a point cloud, and processing the data in MATLAB. Then I wish to publish this cloud to ROS in the PointCloud2 format. I assume that since MATLAB can read the XYZ and RGB values in my subscribed PointCloud2 then there are translations between the two.

This is my current MATLAB pointCloud object that I wish to transform to something similar to the PointCloud2 that i receive.

MATLAB pointCloud

This is my received PointCloud2 message in MATLAB:

ROS PointCloud2 in MATLAB

I would very much appreciate any help! I think that I really don't understand how the PointCloud2 messages are formatted...

2018-05-23 10:50:47 -0500 answered a question MATLAB pointCloud to PointCloud2

Currently there does not appear to be a built-in method to create a PointCloud2 in the MATLAB Robotics Systems Toolbox.