Robotics Class Demonstration

This is a demonstration of skills I’ve learned in my robotics class that shows a simulated UR5 robot drawing my initials in the air. It’s controlled by a custom script and math. Based on ROS, Gazebo, and MoveIt.

Motion planning code using MoveIt:

# Python 2/3 compatibility imports
from __future__ import print_function
from six.moves import input

import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg

try:
    from math import pi, tau, dist, fabs, cos
except:  # For Python 2 compatibility
    from math import pi, fabs, cos, sqrt

    tau = 2.0 * pi

    def dist(p, q):
        return sqrt(sum((p_i - q_i) ** 2.0 for p_i, q_i in zip(p, q)))


from std_msgs.msg import String
from moveit_commander.conversions import pose_to_list

moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node("hw4", anonymous=True)
robot = moveit_commander.RobotCommander()
scene = moveit_commander.PlanningSceneInterface()

group_name = "manipulator"
move_group = moveit_commander.MoveGroupCommander(group_name)

display_trajectory_publisher = rospy.Publisher(
    "/move_group/display_planned_path",
    moveit_msgs.msg.DisplayTrajectory,
    queue_size=20,
)

# We can get the name of the reference frame for this robot:
planning_frame = move_group.get_planning_frame()
print("============ Planning frame: %s" % planning_frame)

# We can also print the name of the end-effector link for this group:
eef_link = move_group.get_end_effector_link()
print("============ End effector link: %s" % eef_link)

# We can get a list of all the groups in the robot:
group_names = robot.get_group_names()
print("============ Available Planning Groups:", robot.get_group_names())

# Sometimes for debugging it is useful to print the entire state of the
# robot:

joint_goal = move_group.get_current_joint_values()
joint_goal[0] = 4.3187
joint_goal[1] = 4.7583
joint_goal[2] = -1.7291
joint_goal[3] = 3.2517
joint_goal[4] = 5.8886
joint_goal[5] = -3.1393
# The go command can be called with joint values, poses, or without any
# parameters if you have already set the pose or joint target for the group
move_group.go(joint_goal, wait=True)

# Calling ``stop()`` ensures that there is no residual movement
move_group.stop()

pose_goal = geometry_msgs.msg.Pose()
pose_goal.position.x = 0.3
pose_goal.position.y = 0.3
pose_goal.position.z = 0.3

move_group.set_pose_target(pose_goal)

plan = move_group.go(wait=True)
# Calling `stop()` ensures that there is no residual movement
move_group.stop()
# It is always good to clear your targets after planning with poses.
# Note: there is no equivalent function for clear_joint_value_targets()
move_group.clear_pose_targets()

print("After setting pose")



waypoints = []

wpose = move_group.get_current_pose().pose


scale = 1;

# J
## Move up
wpose.position.z += scale * 0.05;
#wpose.position.z += scale*0.30;
waypoints.append(copy.deepcopy(wpose));

## Left Top part
wpose.position.x -= scale*0.025;
waypoints.append(copy.deepcopy(wpose));

## Right Top part
wpose.position.x += scale*0.05;
waypoints.append(copy.deepcopy(wpose));

## Back to middle
wpose.position.x -= scale*0.025;
waypoints.append(copy.deepcopy(wpose));

## Back down
wpose.position.z -= scale*0.05;
waypoints.append(copy.deepcopy(wpose));

## "hook" part of J

wpose.position.x -= scale*0.025;
wpose.position.z += scale*0.025;
waypoints.append(copy.deepcopy(wpose));

# I
## Move Up
wpose.position.z += scale*.05;
waypoints.append(copy.deepcopy(wpose));

## Left Top part
wpose.position.x -= scale*0.025;
waypoints.append(copy.deepcopy(wpose));

## Right Top part
wpose.position.x += scale*.05;
waypoints.append(copy.deepcopy(wpose));

## Back to middle
wpose.position.x -= scale*0.025;
waypoints.append(copy.deepcopy(wpose));

## Back down
wpose.position.z -= scale*.05;
waypoints.append(copy.deepcopy(wpose));

## Left Bottom Part
wpose.position.x -= scale*0.025;
waypoints.append(copy.deepcopy(wpose));

## Right Bottom Part
wpose.position.x += scale*.05;
waypoints.append(copy.deepcopy(wpose));

## Back to middle
wpose.position.x -= scale*0.025;
waypoints.append(copy.deepcopy(wpose));

# M
## Move up (left part of M)
wpose.position.z += scale*.05;
waypoints.append(copy.deepcopy(wpose));

## Down right (moddle part of M)
wpose.position.z -= scale*.05;
wpose.position.x += scale*.025;
waypoints.append(copy.deepcopy(wpose));

## Back up right (top left)
wpose.position.z += scale*.05;
wpose.position.x += scale*.025;
waypoints.append(copy.deepcopy(wpose));

## Right side of M (go back down)
wpose.position.z -= scale*.05;


(plan, fraction) = move_group.compute_cartesian_path(
    waypoints, 0.01, 0.0  # waypoints to follow  # eef_step
)  # jump_threshold

display_trajectory = moveit_msgs.msg.DisplayTrajectory()
display_trajectory.trajectory_start = robot.get_current_state()
display_trajectory.trajectory.append(plan)
# Publish
display_trajectory_publisher.publish(display_trajectory)

print("before move_group.execute()")
move_group.execute(plan, wait=True)

print("============ Printing robot state")
print(robot.get_current_state())
print("")

print("============ Printing robot jacobian")
current = move_group.get_current_joint_values()
matrix = move_group.get_jacobian_matrix(current)
print(matrix)
print("")

 

I&E 352: Strategies for Innovation & Entrepreneurship

Description

This Course covers component elements of developing skills needed to launch a venture. Starting at the point of need identification, course covers lean methodology; innovation and entrepreneurship strategy; creating needed financing and resource structures; effectively marketing/communicating innovation and its associated benefits; leading, managing, and working effectively within teams; creating a positive and ethical work culture; and evaluating success.

 

Reflection

When I started this course, my view of a “problem” solvable through entrepreneurship was very different than it is now. Before, I viewed it from a purely technical perspective. I thought if you could create something that makes people’s lives even slightly easier, or slightly improve on the existing status quo, the business side of the equation would solve itself. However, through the case studies, lectures, and discussions we have had in I&E 352, I’ve come to realize business plan viability is an integral part of not only the long term success of the product, but also ingrained in the very problem itself.

Iteration is a concept familiar to me, as it is hammered home in engineering design classes. However, the idea of iteration in business was still a new idea to me, and I was surprised to learn how entrepreneurs can iterate on every step of their business plan, and every facet of their operation. One example that highlighted the effectiveness of testing ideas was the case study on Rent the Runway. Rather than forging ahead with a preconceived business model, they ran focus groups and were able to pivot rapidly in response to customer feedback and events that impacted their business. For many, it is tempting to get pulled into the sunk cost fallacy and become too invested emotionally in an aspect of the product or business plan to make rational decisions on the direction the venture should take. Out of the many case studies we interacted with, the ventures who excelled seemed to all have a heavy emphasis on getting feedback through focus groups, customer complaints, and product testing.

As ventures are always a result of collaboration between multiple people, it’s essential to maximize the efficacy of the team, and in the readings and discussions we saw many guidelines on every aspect of teamwork and leadership in business. It was interesting connecting these with my personal experiences in working with various teams in both my professional and personal life. To me, the themes of embodied by Google’s research into attributes into successful teams ring true. In both pseudo-leadership and assigned positions, the “five keys” we mentioned in class affect the personal and professional relationships have affected personal and professional relationships within the group and directly contributed to success.

As leaders of ventures, entrepreneurs have a very prominent role in putting together a competent, driven team, that shares the vision they do. One important trait I observed in the founders of successful ventures in our class was the ability to step back and realize they were not well suited for a task. As we saw, the startup world was one where an entrepreneur could often end up (and should be willing) to be flexible with their role, jumping from courting investors one day to boxing up orders the next. At the same time, hiring a marketing expert or web developer instead of trying to hack it themselves was an important decision that could make or break some of the companies.

This was a theme that I saw with many topics in class: unlike some other subjects, there often is no “right” or formulaic answer to problems and tasks in the entrepreneurship world. Everything comes with tradeoffs, and often entrepreneurs were held “under the gun” by market factors such as short runways, high burn-rates, and shifting demands.

In business it is often heard “cash is king”, to what extent are the means justified? Ethics in entrepreneurship is a nuanced issue, and one we confronted a lot in this class. From studying social entrepreneurship initiatives, such as Envirofit, to evaluating and suggesting workforce cuts in our case recommendations, this class brought us to think critically about our personal values and their role in business management. My mentor, who I met through this class, also shared extensive real-world insights on the decisions he’s had to make as an entrepreneur and how ethics has played a role in every step of the way.

In the class, we saw a classic example of profit being chosen over ethics: drug companies abandoned research and development of drugs that still showed potential because of reduced projections of future cash flows from the product. It’s easy to point to that and say the pharmaceutical company should’ve chosen to continue development to ensure people can receive treatment and better living conditions. However, the case also made sure the present the statistics and money involved in just attempting to bring a drug to market. Certainly, even if the biggest pharmaceutical corporations attempted to follow through every drug to the end of its development cycle, they would go under. Inherent in the field of business, leaders must choose to draw the line of ethics somewhere to maintain some level of fiscal viability, and the cases and discussions in this class drew me to think about the nuanced issues regarding implementing ethics in business.

Just as many decisions are left up to the agency of the entrepreneur, so is the decision to include personal values in business decisions, and the extent to which it comes into play. It is no coincidence that silicon valley, a place filled with tech startups, also has a reputation for disregarding ethics. Ethics in business can also mean different things to different people. It is a pretty logical conclusion to say an entrepreneur might have an ethical calling to uphold their fiduciary responsibility to shareholders above all, while others might argue for the value of a triple bottom line, which I personally believe in.

Being personally very passionate about environmental issues, especially with regards to emissions and climate change, I could never see myself disregarding that in favor of the bottom line. My first job, at In-N-Out, also instilled in me the value of caring for employees, as their wellbeing and happiness contribute to their drive and productivity for the company. In addition, being an associate also taught me the importance of ensuring customer service was a value-add and a point of differentiation for the company, a lesson I will be sure to bring into my future endeavors.

This course solidified my interest in the entrepreneurship and startup field and taught me the value of having an educated and credible background. To gain a better understanding of the financial side of business and economy, I plan to enroll in markets and management and finance courses at Duke. After hopefully commissioning and serving in a management/leadership role in the Air Force after Duke, I would like to pursue an MBA down the line to dive deeper into the topics touched upon in this course. Many concepts from this course, including lessons on teamwork, finances, and critical analysis transfer over to my daily life, and I’ve already started incorporating the skills learned.

 

Artifact:

Mentorship Reflection

My Story

I grew up in the wonderful state of Utah, among mountains and lakes that fostered my love of the outdoors. I competed in mountain biking and swimming in high school, and today, they are still hobbies I’m passionate about, along with hiking, coding, electronics. My upbringing was certainly unique compared to most of my peers; my family was one of the only families in our community that wasn’t white and Mormon. To offer some perspective, my high school of over 2500 students was over 90% white, and over 93% Mormon.

Although I had a great community growing up and value my friends back home, I yearned to experience diversity of backgrounds and experiences, and this ultimately pushed me to look out-of-state for college, although I do see the draw of the mountains bringing me back to Utah in the long run. One thing nobody seems to catch about me is I’m a really sentimental person. To be honest, I chose to apply early decision to Duke because I didn’t expect to make it in, but at least I could tell my parents I’d tried to apply to a “top” college before choosing a less selective university. Out of the top schools my parents wanted me to apply to, Duke was the only one that seemed remotely cool to me mostly because of its basketball program, so that’s where I sent my long-shot application that somehow ended up working out.

I love the experiences and opportunities I’ve had at Duke, as well as the meaningful connections and relationships I’ve made here, and am extremely grateful to be here. I’m majoring in electrical and computer engineering, with a minor in finance, and of course, the innovation and entrepreneurship certificate. I’ve always been interested in imagining, building, and designing solutions to problems, and studying engineering has always seemed like the logical path to do that as a career. I’d like to pivot into engineering project management, and in the long run, scaling my ideas into new business ventures to optimize efficiency of various processes around the world, and solve problem for a profit and a net benefit for society. Because of this desire, I’ve decided to pursue the certificate. I’m also interested in understanding financial markets and economics, which I feel will fit in nicely with the certificate.

In the long term, I’d like to work my way up from being an engineer to some kind of project management role, and ultimately starting my own company. I feel the coursework I have chosen in the certificate, which mainly revolves around the technology and design pathway, gives me the most background knowledge possible for these career goals as possible coming from my undergraduate experience.

I interned at a startup (300 hour experience) which develops tailored energy business workflow applications to large scale utilities, and there, I was given a lot of autonomy to build a project to allow “smart searching” of data while participating in discussions to maximize its business/client value vs cost, implement security constraints, and enable flexibility to adapt to different customer applications and use cases.

I currently work for a friend’s tutoring startup as the chief technology officer, where I cut costs for his website by over $250/month, integrated PayPal payments into an open source booking application to develop a tailored application that was much cheaper to use than licensing similar commercial software, and have used data to generate useful business insights.

This coming summer, I’ll be interning as a software developer at Amazon, and am excited to see how innovation works in a big corporate environment compared to the startup environment I’m used to. As mentioned before, my long term goal for my career is to solve problems for a profit and net benefit for society, and this is my mantra that drives my decisions in the short term to work towards that.

EGR121: Engineering Innovation

Description

This class consisted of a lecture portion which provided introductory knowledge to various manufacturing, problem solving, electronics, and product development techniques. In addition, “design challenges” would be assigned to groups that were randomly created. These design challenges involved utilizing lab time to research, plan, and execute solutions to given design challenges.

Reflection

I chose to take this class for my elective because I wanted to explore how innovation relates to engineering, which I plan on majoring in. In addition, I wanted to explore the intersection of electrical and mechanical engineering, and look into solutions that involve both fields. Because this class is primarily for mechanical engineers and I am an ECE major, this put me in a position to have a unique perspective and think about problems and solutions from both an electrical and mechanical context.

I think the most valuable thing I learned from this class was how to be flexible while iterating and not be fixated on one solution. There were several instances where we clearly saw a better solution while in the middle of our prototyping process for these design challenges, and “jumping ship” to a better solution took some risk, but it was worth it. In addition, it taught me how valuable lower fidelity prototypes are because if we had tried to go straight into high quality prototypes, it would’ve been a lot harder to change solutions.

Artifact

Written Report

Description

This was a written report for a solution to one of our design challenges. In it, we explain the purpose of the solution, our ideation and design methods, and our execution.

EGR101: Engineering Design and Communication

Description

Engineering design and communication involved a semester long design process where groups were assigned a design problem. Throughout the semester, groups completed the various stages of the engineering design process, including research, ideation, low-fi/high-fi prototyping, etc. These design problems were derived from the needs of a client, and at the end of the semester, the client would be presented with the solution.

Reflection

For my gateway elective, I chose to take EGR101 mostly because it’s a requirement for all engineering majors. However, I was also intrigued and excited by the idea of applying critical thinking and innovating through iteration and ideation to solve a design problem.

I think the most valuable things I learned in the course was how to effectively work in teams and take advantage of the diverse strengths we had in our group. This experience also taught me that sometimes being a leader means being a follower — there were times I felt I was definetly leading the team, but there were also times where I could contribute the most to the team by following someone else who knew more about the specific aspect of the project. In addition, it taught me how important it is to communicate clearly and make sure everyone is on the same page with not only the status of the project, but also our goals and feelings about what we wanted out of the project and the direction we wanted to take it. I felt our group dynamic worked very well overall and that’s because we all put effort into contributing to the project and staying informed about other group members.

Artifact

 

Description

This was a status update to one of our project sponsors towards the end of the semester that showcases our design.