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

johnyang's profile - activity

2021-12-23 08:15:04 -0500 received badge  Self-Learner (source)
2019-05-20 02:15:28 -0500 marked best answer Problem with ROS_ASSERT

I am running into the same problem as: https://answers.ros.org/question/2163...

std::string serial_number_str;
if(!config_nh_.getParam("serial_number", serial_number_str))
{
    ROS_ERROR("You must specify a serial number");
    valid_ = false;
}
else
{
    ROS_ASSERT( SerialNumberFromHex(serial_number_str, &serial_number_) );
    ROS_INFO_STREAM("serial number="<<serial_number_str<<" ,hex-> "<<serial_number_);
}

The exact same code above works on one machine running Ubuntu 14.04 but failed on a PC running 14.02 (both x64)

However, I found out if I removed ROS_ASSERT, SerialNumberFromHex() function will work. If I use the original code, serial_number_ will never obtain the correct reading from the serial_number_str.

Anyone can explain why this is happening? I know I can get it to work if I modify the code, but I really want to understand why this is happening.

Also I tried to put ROS_INFO() to print out the values, I noticed ROS_ASSERT will not allow me to print out anything:

bool SerialNumberFromHex(const std::string& str, uint64_t* serial_number) {
    std::stringstream ss;
    ss << std::hex << str;
    ROS_INFO_STREAM("ss="<<ss.str());
    ss.flush();
    ROS_INFO_STREAM("ss="<<ss.str());
    ss >> *serial_number;
    ROS_INFO_STREAM("ss="<<ss.fail());
    return true;
}

This kinda tells me maybe the SerialNumberFromHex() function is never called? So I tried ROS_ASSERT(false) directly, and surprisingly it didn't throw fatal error as expected. So something wrong with ROS_ASSERT command on my machine but without compilation error. Anyone has any clue what's causing the problem (like compiler problem etc)?

2019-05-20 01:57:02 -0500 marked best answer How to set an intial joint state to a robot arm in gazebo

Is there a way to give an initial joint state to a robot arm in gazebo? (e.g. from the launch file setting)

2019-03-08 09:58:09 -0500 received badge  Famous Question (source)
2019-01-11 16:51:37 -0500 received badge  Famous Question (source)
2018-11-18 22:25:33 -0500 received badge  Supporter (source)
2018-10-11 07:46:04 -0500 received badge  Notable Question (source)
2018-07-29 08:09:49 -0500 received badge  Notable Question (source)
2018-07-29 08:09:49 -0500 received badge  Popular Question (source)
2018-07-19 13:14:08 -0500 received badge  Teacher (source)
2018-07-19 13:14:08 -0500 received badge  Self-Learner (source)
2018-07-16 23:16:30 -0500 edited question How to create a custom hardware_interface?

How to create a custom hardware_interface? I have created my own joint_trajectory_controller and hardware interface. Whe

2018-07-16 23:14:52 -0500 asked a question How to create a custom hardware_interface?

How to create a custom hardware_interface? I have created my own joint_trajectory_controller and hardware interface. Whe

2018-04-29 22:08:47 -0500 marked best answer failed to roslaunch remotely on another computer

I am trying to remotely launch realsense from another computer. Pinging the remote PC has no problem. I can also execute the launch file from remote computer with roscore on my current PC successfully. I tried to set up a launch file like following:

<launch>
    <machine name="croc3up1" address="138.25.248.87" user="croc3up1" password="croc3up1" env-loader="~/catkin_ws/src/croc3_robot/config/env.sh" default="true"/>
    <!-- just testing a simple node-->
    <node machine="croc3up1" pkg="tf" type="static_transform_publisher" name="virtual_joint_broadcaster_0" args="0 0 0 0 0 0 link0 world 100" />
</launch>

I also tried this:

<include file="$(find realsense_test)/launch/realsense_test.launch" machine="croc3up1"/>

However I am getting the following error message:

... logging to /home/johnyang/.ros/log/25f83d3e-a7db-11e6-bef6-086266c7c72e/roslaunch-johnyang-ubuntu1404-7206.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.

started roslaunch server http://138.25.248.22 :33411/
remote[138.25.248.87-0] starting roslaunch
remote[138.25.248.87-0]: creating ssh connection to 138.25.248.87:22, user[croc3up1]
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://localhost:11311 ~/catkin_ws/src/croc3_robot/config/env.sh roslaunch -c 138.25.248.87-0 -u http://138.25.248.22 :33411/ --run_id 25f83d3e-a7db-11e6-bef6-086266c7c72e]
remote[138.25.248.87-0]: ssh connection created
remote[138.25.248.87-0]: [:33411/] is not a launch file name
The traceback for the exception was written to the log file

[138.25.248.87-0] killing on exit
remote roslaunch failed to launch: croc3up1
The traceback for the exception was written to the log file

env.sh looks like following:

export ROS_HOSTNAME="138.25.248.87"
export ROS_IP="138.25.248.87"
. ~/catkin_ws/devel/setup.sh
exec "$@"

It sounded like the env.sh file is executed properly and ssh connection is established correctly. However it seemed having difficulty finding the the correct launch file to execute (throwing "is not a launch file name" error). The launch file is definitely put on the 2nd PC.

If I just manually ssh into the 2nd PC and I can perform all the roslaunch straight away (since I setup source ~/catkin/devel/setup.bash in ~/.bashrc etc already).

Any clue why using the "machine" tag to remotely start launch files does not work here? (I'm using ROS Jade) Thanks.

2018-04-27 08:51:55 -0500 received badge  Famous Question (source)
2018-04-20 05:10:57 -0500 received badge  Famous Question (source)
2018-04-04 13:58:50 -0500 received badge  Famous Question (source)
2018-02-27 22:21:51 -0500 received badge  Notable Question (source)
2018-02-27 22:14:15 -0500 commented question How to listen to static transform from robot state publisher using the tf2 TransformListener?

Are you able to share your urdf model, launch files and the code that calls the TransformListener with me?

2018-02-27 21:31:41 -0500 commented question How to listen to static transform from robot state publisher using the tf2 TransformListener?

Weird. Are you using ROS jade? I am using robot_state_publisher. I can get most of the TF correctly except the static tf

2018-02-23 11:21:15 -0500 received badge  Popular Question (source)
2018-02-18 17:02:29 -0500 commented question How to listen to static transform from robot state publisher using the tf2 TransformListener?

But when I tried to call lookupTransform() with "world", it can't find the link. Do you have some example code to help m

2018-02-18 13:15:23 -0500 received badge  Popular Question (source)
2018-02-15 20:44:16 -0500 edited question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the tf2 TransformListener? I have set up a robot stat

2018-02-15 20:43:44 -0500 edited question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the tf2 TransformListener? I have set up a robot stat

2018-02-15 20:34:11 -0500 edited question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the tf2 TransformListener? I have set up a robot stat

2018-02-15 20:31:44 -0500 commented question How to listen to static transform from robot state publisher using the tf2 TransformListener?

I updated the question with some example code but those are just the same as from the tutorial of getting a normal tf bu

2018-02-15 20:30:55 -0500 edited question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the tf2 TransformListener? I have set up a robot stat

2018-02-15 20:24:24 -0500 edited question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the TransformListener? I have set up a robot state pu

2018-02-15 20:24:21 -0500 edited question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the TransformListener? I have set up a robot state pu

2018-02-15 17:36:07 -0500 asked a question How to listen to static transform from robot state publisher using the tf2 TransformListener?

How to listen to static transform from robot state publisher using the TransformListener? I have set up a robot state pu

2017-12-24 10:23:40 -0500 received badge  Famous Question (source)
2017-11-16 09:27:01 -0500 received badge  Famous Question (source)
2017-10-23 03:45:13 -0500 received badge  Notable Question (source)
2017-10-23 03:45:13 -0500 received badge  Popular Question (source)
2017-10-17 06:36:53 -0500 received badge  Notable Question (source)
2017-10-17 05:03:03 -0500 received badge  Popular Question (source)
2017-09-13 01:07:04 -0500 edited question Problem with ROS_ASSERT

Problem with ROS_ASSERT I am running into the same problem as: https://answers.ros.org/question/216315/help-using-epos_h

2017-09-13 00:36:04 -0500 asked a question Problem with ROS_ASSERT

Problem with ROS_ASSERT I am running into the same problem as: https://answers.ros.org/question/216315/help-using-epos_h

2017-09-13 00:29:21 -0500 commented answer Help using epos_hardware

I'm running into the same problem here now. However, the exact same code works on a computer running Ubuntu14.04 but fai

2017-09-11 23:54:39 -0500 commented answer Moveit planning scene collision padding

I'm still not 100% sure what is the best way to add this parameters. I created a paddings.yaml file and loaded it throu

2017-06-21 10:52:07 -0500 received badge  Student (source)
2017-06-21 10:50:56 -0500 received badge  Notable Question (source)
2017-03-20 03:07:30 -0500 received badge  Popular Question (source)
2017-03-20 02:15:37 -0500 received badge  Notable Question (source)
2017-03-16 23:58:49 -0500 asked a question how to pause and resume when controlling a robot arm with joint_trajectory_controller with FollowJointTrajectoryAction

I am able to send a joint trajectory (control_msgs::FollowJointTrajectoryGoal) to command the robot using FollowJointTrajectoryAction (from joint_trajectory_controller). However I want to be able to pause the resume the action. I notice there is a feedback callback function option available, but I don't think it is returning anything useful in order to pause/resume actions.

Does anybody know how to do this? I can only think of implementing something my own to trace where it is up to in a trajectory by polling the current jointstate myself. When I wanna pause, I stop the action. When I wanna resume, I resend the trajectory from where it was up to onwards.

Also does cancelAllGoals() function stop all the trajectory motion? (see code below)

#include <actionlib/client/simple_action_client.h>
typedef actionlib::SimpleActionClient< control_msgs::FollowJointTrajectoryAction > TrajClient;

// Initialize
TrajClient* traj_client_ = new TrajClient("/"+robot_part_name+"/joint_trajectory_controller/follow_joint_trajectory", true);

// Start 
traj_client_->sendGoal(goal);

// Stop
traj_client_->cancelAllGoals();
2017-02-23 00:39:24 -0500 received badge  Famous Question (source)
2017-02-09 05:07:29 -0500 received badge  Popular Question (source)
2016-12-20 23:03:09 -0500 asked a question how to use joint_trajectory_controller to link with physical motor

I have successfully setup using JointPositionController to control a single motor. However, I would like to use joint_trajectory_controller so that I can send a set of joints at once. I was able to see the connection between link, transmission and joint handles clearly here. Does anybody have any simple example to share?

Note: I'm not sure if this can be helpful in my case: http://docs.ros.org/jade/api/joint_tr...